top of page
Search
CCC 2000 S3 or J5:Surfin
https://www.cemc.uwaterloo.ca/contests/computing/2000/stage1/2000CCCStage1Contest.pdf Solution: Build a map to store each page URL...
Jul 19, 20202 min read
CCC 2019 J3: Cold Compress
https://www.cemc.uwaterloo.ca/contests/computing/2019/stage%201/juniorEF.pdf Solution: Count each identity characters, if character x 's...
Jul 14, 20201 min read
CCC 2019 J2 - Time to Decompress
This is an implementation question. Solution: Input the pair parameters n and x, print n number x. def decode(n, x): print(n*x) m =...
Jul 14, 20201 min read
CCC 2019 J1:Winning Score
This is simple math question. Solution: apoints = af*3 + as*2 + at bpoints = bf*3 + bs*2 + bt apoints > bpoints , print A apoints <...
Jul 13, 20201 min read


Queue
Like Stack, Queue is a linear structure that follows a particular order in which the operations are performed. The order is First In...
Jul 13, 20202 min read


Stack
The stack is a linear data structure that follows a particular order in which the operations are performed. The order may be LIFO(Last In...
Jul 13, 20201 min read
CCC 2020 J4:Cyclic Shifts
https://www.cemc.uwaterloo.ca/contests/computing/2020/ccc/juniorEF.pdf Solution: Two strings are T and S, T length > S length. Check if...
Jul 13, 20201 min read
CCC 2020 J3 - Art
https://www.cemc.uwaterloo.ca/contests/computing/2020/ccc/juniorEF.pdf Solution: FInd xmin, ymin and xmax ymax, The rectangular's...
Jul 12, 20201 min read
CCC 2020 J2: Epidemiology
This is a math question. if R > 1, then days = log(1 + (P*(R-1)+1)/N, R) else, days = P/N import math P = int(input()) N = int(input())...
Jul 9, 20201 min read
CCC 2020 J1: Dog Treats
This is a very easy question! S = int(input()) M = int(input()) L = int(input()) re = S + 2*M + 3*L if re >= 10: print("happy") else:...
Jul 8, 20201 min read
Depth First Search
Depth First Search (DFS) The DFS algorithm uses the idea of backtracking. It involves exhaustive searches of all the nodes by going...
Jul 7, 20201 min read
CCC 2018 Problem S3: RoboThieves
This is a graph short path problem. Build a Graph data structure. If the cell (x,y) is a camera, special handle the row x, and the column...
Jul 5, 20202 min read
CCC 2018 S1: Voronoi Villages
The boundaries of a neighbourhood are defined by the two adjacent villages. 1. Sort the villages,. 2. Compute the midpoint of each...
Jul 5, 20201 min read
Breadth First Search
Graph traversals Graph traversal means visiting every vertex and edge exactly once in a well-defined order. While using certain graph...
Jul 5, 20202 min read
CCC 2019 S3: Arithmetic Square
CCC 2019 S3:Arithmetic Square Case 1: 1 x Case 2: 2 x Case 3: 3 x Case 4: 4 x We can set row by row , the column by column, you can...
Jun 29, 20203 min read
CCC 2018 J4/S2: Sunflowers
Matrix rotated anti clockwise 90 degree, next 90 degree (180 degree), next 90 degress(270 degree), next 90 degree(360 degree). Look the...
Jun 28, 20202 min read
CCC 2019 S2: Pretty Average Primes
For this problem, we can use a simple for-loop to generate values of a and b.Set a=i and b=2n−i. Loop it through the integers from 2 to...
Jun 28, 20201 min read
CCC 2019 J4/S1 - Flipper
It is easy , swap rows or swaps columns by 'H' or 'V' rawM = [[1,2], [3,4]] def hFlip(): t = rawM[0][0] rawM[0][0] = rawM[1][0]...
Jun 28, 20201 min read


Graph
A graph is a pictorial representation of a set of objects where some pairs of objects are connected by links. The interconnected objects...
Jun 27, 20202 min read
CCC 2020 S2 or J5: Escape Room
Perform a depth-first search (DFS) on the cells. There areN2cells and individually finding the factors of each number. For a faster...
Jun 21, 20202 min read
One-time Donations
I hope I can solve all CCC problems!
bottom of page