top of page
Search
CCC 2014 J5: Assigning Partners
Use a dictionary to store members of each other. if can not find a pair, print "bad, otherwise print "good". N = int(input()) name1 =...
Dec 29, 20201 min read
CCC 2014 J4: Party Invitation
This is a math question. The original list is from 1 to N. Then remove elements that are multiple cn_i from the list. N = int(input())...
Dec 29, 20201 min read
CCC 2014 J3: Double Dice
This a math question. Antonia and David are playing a game. Each player starts with 100 points. For each round, who win with n points,...
Dec 29, 20201 min read
CCC '04 J1 - Squares
Easy math question! n = int(input()) ans = 1 while ans*ans <= n: ans += 1 ans -= 1 print("The largest square has side length " +...
Dec 13, 20201 min read
CCC 1998 S4:Lottery
https://cemc.uwaterloo.ca/contests/computing/1998/stage1/1998CCCStage1Contest.pdf Change the input string as a list 2. Handle "X"...
Dec 12, 20201 min read
CCC 1996 S4:When in Rome...
https://cemc.uwaterloo.ca/contests/computing/1996/stage1/d-prob.html The problem can be solved in two parts: Rome to digits Digits to...
Dec 12, 20202 min read
CCC 2011 J1: Which Alien?
https://www.cemc.uwaterloo.ca/contests/computing/2011/stage1/juniorEn.pdf Easy problem. antennas = int(input()) eyes = int(input()) if...
Nov 14, 20201 min read


Selection sort
The algorithm divides the input list into two parts: a sorted sublist of items which is built up from left to right at the front (left)...
Nov 14, 20201 min read
CCC 2020 S3: Searching for Strings
https://www.cemc.uwaterloo.ca/contests/computing/2020/ccc/seniorEF.pdf The problem can be solved only by c++. The key thing is the...
Nov 2, 20202 min read
CCC 2015 J5: π-day
https://www.cemc.uwaterloo.ca/contests/computing/2015/stage%201/juniorEn.pdf Use recursive to solve it: if pieces < people: return 0 if...
Oct 30, 20201 min read
CCC 2015 J4: Wait Time
https://www.cemc.uwaterloo.ca/contests/computing/2015/stage%201/juniorEn.pdf M = int(input()) f = [0]*101 r = [0]*101 s = [0]*101 time =...
Oct 30, 20201 min read
CCC 2015 J3:Rovarspr ¨ aket
https://www.cemc.uwaterloo.ca/contests/computing/2015/stage%201/juniorEn.pdf This is a string handling question. Build three string based...
Oct 30, 20201 min read
CCC 2016 J5 and S2: Tandem Bicycle
This is a Greedy Algorithm. Because if the members of a pair have speeds a and b, then the bike speed of the pair is max(a, b), then...
Oct 29, 20201 min read
CCC 2016 J4: Arrival Time
https://www.cemc.uwaterloo.ca/contests/computing/2016/stage%201/juniorEn.pdf The problem is a math problem. 1. Transfer 7:00 and 10:00...
Oct 29, 20201 min read
CCC 2017 J5 and S3: Nailed It!
https://www.cemc.uwaterloo.ca/contests/computing/2017/stage%201/juniorEF.pdf The solution: This is a counting sort problem. we can define...
Oct 28, 20201 min read
CCC 2017 J4: Exactly Electrical
https://www.cemc.uwaterloo.ca/contests/computing/2017/stage%201/juniorEF.pdf The question asks to compute all arithmetic sequences....
Oct 28, 20201 min read
CCC 2017 J3: Exactly Electrical
https://www.cemc.uwaterloo.ca/contests/computing/2017/stage%201/juniorEF.pdf The solution: input: x1, y1 # start point coordinate x2, y2...
Oct 28, 20201 min read
CCC 2018 J5: Choose your own path
This is graph question, use DFS to do it. 1. Start from the first page, use DFS to iterative all neighbor pages. Update the minimum...
Sep 1, 20201 min read
CCC 2016 J3: Hidden Palindrome
https://cemc.uwaterloo.ca/contests/computing/2016/stage%201/juniorEn.pdf Using capabilities of substrings put all possible palindromes...
Aug 28, 20201 min read
CCC '16 S4 - Combining Riceballs
https://www.cemc.uwaterloo.ca/contests/computing/2016/stage%201/seniorEn.pdf Solution 1: recursive that is based on DP solution, please...
Aug 13, 20202 min read
One-time Donations
I hope I can solve all CCC problems!
bottom of page