Competitive Programming  Posted by Liang  2 years ago
Practice problems
Practice with strings
Practice with stacks/list
Practice with strings AND list
4
Competitive Programming  Posted by Liang  2 years ago
Computer Science
BEST SITES FOR COMPUTER SCIENCE
 Talks about how fast a programming solution is.
 eg O(1) takes 1 iteration (constant time no matter n)
 O(n) takes n iterations
 O(n^2) will be slower than the above
 O(n!) will be faster than the above when n is small, but way slower when n is large.
 Like arrays, but you can only add/remove items from the end.
 A good analogy is to think of a stack as a stack of books; you can remove only the top book, and you can only add a new book on the top.
 Two basic operations: push & pop
 Problems
 One can think of a queue like a cafeteria line: the person at the front is served first, and people are added to the line at the back. Thus, the first person to enter the queue is the first to be served, and the most recent person to enter the queue is served after everyone else
 Two basic operations
 enqueue  insert element at the tail of the queue
 dequeue  remove element at the start of the queue
 Like Arrays, but are an unordered group of items. Each item does not contain a pointer to the next/previous node.
 Useful if you need to check if an item has been "seen" before.
 Problems
 Create a program that outputs the factorial of a number using RECURSION. (no loops)
Graph Theory
0
Competitive Programming  Posted by Liang  2 years ago
Graph Theory
Here are some Graph Theory Introduction Videos and Problems
Textbased introduction to graph theory (click this first and as you get to the topics, click on the below videos)
Introduction to Königsberg Bridge Problem (using nodes)
The Four Colour Theorem
Explanation of Graph Theory Terms
0
Competitive Programming  Posted by Liang  2 years ago
Feb 5 debrief
Here's what we learned from cccgrader.com today
 They have a variety of previous contests that you can submit your solution to (just like dmoj.ca)
 On the actual day of the test, you are ALLOWED to use an IDE, debugger, tools, and documentation. Just not google. I recommend that you BRING YOUR OWN LAPTOP.
 Just like dmoj, you can submit multiple time, and CCCGRADER will tell you if its correct, run time error, wrong answer, or timelimit exceeded.
Homework & next meeting date (homework is in bold)
We did the CCC Senior 2011 contest today at lunch. COMPLETE THE PARTY INVITATION QUESTION AND POETRY QUESTION ASSIGNED LAST WEEK BY THURSDAY.
Try to do senior 1, 2, 4 for 2011 (they are easiest). If you have time, try 3 & 5. Complete senior 1, 2 & attempt/complete 4 by friday.
 CCC '11 S1  English or French?
 String, character, loop
 Solutions
 Liang's solution (c++)
 Andrew's solution (c++)
 Frank's solution
 Jonathan's solution (java)
 Jonah's solution (java)
 Eric's solution
 Kyle's solution (java)
 Erik's solution (python)
 Michael's solution (java)
 Kevin's solution (python)
 CCC '11 S2  Multiple Choice
 Loops
 Solutions
 Liang's solution (c++)
 Andrew's solution (c++)
 Frank's solution
 Jonathan's solution (java)
 Jonah's solution (java)
 Eric's solution
 Kyle's solution (java)
 Erik's solution (python)
 Michael's solution (java)
 Kevin's solution (python)
 CCC '11 S3  Alice Through the Looking Glass
 2d arrays & recursion
 Solutions
 Liang's solution (c++)
 Andrew's solution (c++)
 Frank's solution
 Jonathan's solution (java)
 Jonah's solution (java)
 Eric's solution
 Kyle's solution (java)
 Erik's solution (python)
 Michael's solution (java)
 Kevin's solution (python)
 CCC '11 S4  Blood Distribution
 Arrays & loops
 Solutions
 Liang's solution (c++)
 Andrew's solution (c++)
 Frank's solution
 Jonathan's solution (java)
 Jonah's solution (java)
 Eric's solution
 Kyle's solution (java)
 Erik's solution (python)
 Michael's solution (java)
 Kevin's solution (python)
 CCC '11 S5  Switch
 Arrays & loops
 Solutions
 Liang's solution (c++)
 Andrew's solution (c++)
 Frank's solution
 Jonathan's solution (java)
 Jonah's solution
 Eric's solution
 Kyle's solution (java)
 Erik's solution (python)
 Michael's solution (java)
 Kevin's solution (python)
0
Competitive Programming  Posted by Liang  2 years ago
Useful Links
Here is a list of important links from most important to least important. Please view them if you have time.
 https://www.coursera.org/learn/algorithmspart1
 Learn about algorithms, sorting, searching, and graph etc
 DMOJ (online grader that contains a bunch of problems, including past ccc contests)
 http://tjsct.wikidot.com/
 Read about computer science and theory topics. Really beginner friendly.
 This is really useful. look into these if you have time:

Know your basic data structures: linked list, array, stack, queue
Know the big 3: greedy algorithms, divide and conquer, and Dynamic Programming
And know graph theory (BFS, DFS, Dijkstra's)

 https://sphereengine.com/demo/1onlinecompiler
 Online compiler (If you don't have access to your language's ide)
 http://mmhs.ca/ccc/index.htm
 Unofficial CCC solutions
 http://compsci.ca/blog/gettingreadyforthecanadiancomputingcompetition/
 CCC TIPS!
 https://www.quora.com/Whatbasicdatastructuresandalgorithmsshouldonelearnbeforestartingcompetitiveprogramming
 Advanced Data and Computer Science topics.
0
Competitive Programming  Posted by Liang  2 years ago
Feb 3
Hello fellow programmers! Here is the Todo list for next Thursday:
 REGISTER an online account for CCC, so we can practice online! Register here https://cccgrader.com/register.php
 Our school code is 090702221
 You must decide if you are writing the SENIOR or JUNIOR contest by THIS TUESDAY
 OUR CONTEST IS ON FEB 20, that leaves 17 days to study for it. We are going to need more than one meeting a day.
Homework
You must attempt all questions by Thursday (changed to tuesday)
 CCC '14 S1  Party Invitation
 More practice with arrays/vectors/list/set whatever you choose to use. For this question try challenging yourself by only using the documentation and not google/stack overflow.
 Solutions
 CCC '03 S2  Poetry
 Introduction to strings & string manipulation. You should learn how to loop through the characters in a string, as well as the substring function in your language. This is an easy question, should not take you long to complete.
 Solutions
 Liang's solution (c++)
 Andrew's solution (c++)
 Frank's solution
 Jonathan's solution (java)
 Jonah's solution (java)
 Eric's solution
 Kyle's solution (java)
 Erik's solution
 Michael's solution
 Kevin's solution
 CCC '03 S4  Substrings
 This is a senior problem that revolves around STRINGS. This is easily done by brute force, but you need to find an optimized solution. (hint: suffix tree) btw i dont really get it so rip
 Solutions
 Liang's solution (c++ brute force method, partial marks)
 Andrew's solution
 Frank's solution
 Jonathan's solution (java, suffix tree, FULL MARKS ;o)
 Jonah's solution
 Eric's solution
 Kyle's solution
 Erik's solution
 Michael's solution
 Kevin's solution
PLEASE MESSAGE IN THE GROUP CHAT THE DAY OF THE CONTEST SO THAT I KNOW YOU READ THIS.
0
Competitive Programming  Posted by Liang  3 years ago
Update for Jan 27, 2019!! New Homework (optional)
Hello fellow programmers, hope your weekend's been good!
Great job for completing babbling brooks! All solutions from everyone will be posted in the previous post. You can visit that here.
Please vote in the group chat poll what time you would like to debrief the solutions to babbling brooks (either monday or at school)

If you guys go back to the possible meeting dates, https://www.when2meet.com/?7453737xpwuP

The best time is monday/tuesday/wednesday after school
or at lunch tuesday/thursday

Homework
Here is the optional EASY homework for our next meeting days.
 CCC '14 S1  Party Invitation
 More practice with arrays/vectors/list/set whatever you choose to use. For this question try challenging yourself by only using the documentation and not google/stack overflow.
 Solutions
 Liang's solution
 Andrew's solution
 Frank's solution
 Jonathan's solution
 Jonah's solution
 Eric's solution
 Kyle's solution
 Erik's solution
 Michael's solution
 CCC '03 S2  Poetry
 Introduction to strings & string manipulation. You should learn how to loop through the characters in a string, as well as the substring function in your language. This is an easy question, should not take you long to complete.
 Solutions
 Liang's solution
 Andrew's solution
 Frank's solution
 Jonathan's solution
 Jonah's solution
 Eric's solution
 Kyle's solution
 Erik's solution
 Michael's solution
0
Competitive Programming  Posted by Liang  3 years ago
Meeting 2: Jan 25 Homework & Debrief
Hello fellow programmers!
Here's what we debriefed from the meeting at lunch.
 Programming language choice (c++ vs java vs python)
 Because each programming language is very similar, choose a programming language and stick to it until the exam. There is information below to help you decide.
 Pros/cons to c++
 Fastest language, will be able to solve any question under the time limit.
 Because its a low level programing language, it's syntax is strict and you will likely need to learn more.
 input/output is very easy
 Pros/cons to python
 Has great built in string manipulation through array indices
 Very fast to hack a solution because
 It's syntax is not strict
 It usually takes longer to run a program in python than c++ or java
 getting the input is a bit complicated
 Pros/cons to java
 Slightly fast language, will probably be able to solve any question under the time limit.
 Because its a low level programing language, it's syntax is strict and you will likely need to learn more
 Input/output is very easy.
 Questions that we assigned last class
 CCC '14 J1  Triangle Times
 Assigned to make sure you know basic conditional syntax + how to input/output in your language
 Solution in c++
 Solution in java
 Solution in python
 CCC '16 J3  Hidden Palindrome
 Assigned to make sure you know how to manipulate strings + to show you that brute forcing is okay if the input specification is small. To do this question, you can brute force (check every letter and at every length to find max palindrome size)
 Solution in c++
 Solution in java
 Solution in python
 CCC '16 S5  Circle of Life
 This monster of a fricking problem is to show you one thing: although the question seems doable, you will only get partial marks unless you are able to optimize your program. For example, Jonah's program works, although it gets partial marks (congrats btw this is a hard question). The optimized solution in java will be posted below (refactored into java from D by Jonathan) /
 Jonah's solution in java
 Jonathan's optimized solution in java
 This monster of a fricking problem is to show you one thing: although the question seems doable, you will only get partial marks unless you are able to optimize your program. For example, Jonah's program works, although it gets partial marks (congrats btw this is a hard question). The optimized solution in java will be posted below (refactored into java from D by Jonathan) /
 CCC '14 J1  Triangle Times
Homework
 CCC '00 J4  Babbling Brooks
 Skills needed: looping through input & learning vectors/arrayList (if doing c++/java) or learning lists (python)
 DUE MONDAY
 Solutions
 Let me, Andrew, or Jonathan know if you need help
Please reply in the facebook group chat your preferred programming language + the day the homework is due.
0
Competitive Programming  Posted by Liang  3 years ago
Our Very First Post Jan 21
Meeting debrief:
 By Friday, all of must complete 3 assigned questions (easy, medium, and hard). Use the language of your choice, but it must be either (c++, java, or python). Bonus marks if you solve using all 3 languages! There are other languages, but I strongly recommend the above three because they are the most used in competitive programming and there are a lot of material online that can help us.
 On Friday, we are going to decide what language we will use as a team. Please research the pros or cons. And be ready to present why you chose your language. Read more about the pros/cons here to get started.
 We need a regular meeting time. Please let me know what days you're available :3
Other Information
Waterloo site contest details/format  CEMC  CCC Details  Computing Contests  University of Waterloo
Sample programs please click on your language to see how to take input/output https://cccgrader.com/sample_soln.pdf
Questions:
1. Easy question J1: Triangle Times
Skills used: logical reasoning, basic if/else conditions
2. Intermediate question J3: Hidden Palindrome
Skills used: loops, string manipulation, algorithm logic
3. Hard but possible question S5: Circle of Life
Skills used: loops, critical thinking, good luck lmaooaooao
LET LIANG KNOW IF YOU HAVE ANY QUESTIONS. THANKS
1
Calculus Marks  Posted by WangChangBang  3 years ago
Open Interval
4
AP Calculus  Posted by Liang  3 years ago
How fucked are you for AP Calclus chapter 4 test
3
Programming Languages  Posted by lancechen  3 years ago
English is the best programming language
0
Programming Languages  Posted by Liang  3 years ago
Did you know?
0
Programming Languages  Posted by Liang  3 years ago
What's your favourite programming language?
4
Porn  Posted by stuffbyliang@gmail.com  3 years ago
Can I do many lines
0