top of page
Search
CCC '24 J5 - Harvest Waterloo
#include<iostream> #include <vector> #include <algorithm> #include <cmath> #include <stack> using namespace std; int main() { int r, c,...
Apr 1, 20241 min read
CCC '24 J4 - Troublesome Keys
s1 = input() s2 = input() silly = '' silly_o = '' quiete = '-' i = 0 j = 0 while i < len(s1) and j < len(s2): if s1[i] != s2[j]: if...
Mar 12, 20241 min read
CCC '22 J5 - Square Pool
#include<iostream> #include <vector> #include <algorithm> #include <cmath> using namespace std; bool rowcom(pair<int, int> a, pair<int,...
Feb 19, 20241 min read
CCC 2013 J5/S3
#include <iostream> #include <string> #include <map> #include <vector> #include <algorithm> #include <cmath> using namespace std; char...
Dec 18, 20231 min read
CCC '17 S3 - Nailed It! c++
#include <iostream> #include <string> #include <map> #include <set> #include <map> using namespace std; int main(){ int n; cin >> n;...
Nov 11, 20231 min read
2018 CCC J5 c++
#include <iostream> #include <vector> #include <stack> #include <queue> #include <set> using namespace std; int main() { int N; cin >>...
Oct 20, 20231 min read
2019 CCC J5 c++ solution
#include <iostream> #include <vector> #include <stack> #include <queue> #include <set> using namespace std; //index 0 ===>rule string...
Oct 19, 20231 min read
2023 CCC J5 c++ solution
This is a graph level traversal problem. Start with the first char of seed string, go to 8 directions for next char. when you try to go...
Jul 7, 20233 min read
2018 CCC J3 c++ vector solution
# include <iostream> # include <vector> using namespace std; void rotateAclockwise90Vector(vector < vector < int >> & A, int N) { if (N...
Jun 26, 20231 min read
CCC '21 J4 - Arranging Books--C++ version
#include <iostream> #include <string> using namespace std; int main(){ string whole; cin >> whole; int L = 0; int M = 0; int S = 0;...
Jun 7, 20231 min read
CCC '10 J3 - Punchy
A = 0 B = 0 m = {'A': A, 'B': B} while True: cmds = input().split(" ") if cmds[0] == '1': m[cmds[1]] = int(cmds[2]) elif cmds[0] ==...
May 14, 20231 min read
CCC '21 S4 - Daily Commute
Please read the problem description: https://www.cemc.uwaterloo.ca/contests/computing/2021/ccc/seniorEF.pdf The problem is BFS question....
Feb 25, 20222 min read
CCC 2021 J4:Arrange books
https://cemc.uwaterloo.ca/contests/computing/2021/ccc/juniorEF.pdf The problem is math problems. Assume, L is the number of char L, M is...
May 18, 20212 min read
CCC 2021 S3: Lunch Concert
This is a binary search problem. Implement the algrithom: Compute mid-1, mid, mid+1, if P(mid-1)< P(mid)< p(mid+1), the result will be...
Mar 14, 20211 min read
2021 CCC S2/J5: Modern Art
https://cemc.uwaterloo.ca/contests/computing/2021/ccc/juniorEF.pdf Data structure: bool grid[m+1][n+1] , B is false, G is true bool ...
Feb 24, 20211 min read
2016 S4: Combining Riceballs
This is a dynamic programming question. Suppose f(i, j) express if it can be combined from the ith rice ball to the jth rice ball....
Feb 20, 20212 min read
CCC 2020 S5: Josh’s Double Bacon Deluxe
DP problems. They choose the coach’s burger. In this case, no further disruptions are caused and Josh gets his burger. They choose Josh’s...
Jan 10, 20211 min read
CCC 2014 S5: Lazy Fox
The fox start from (0,0) that is the starting point, it has no treat. Then the fox can visit from every point of N to every other point...
Jan 4, 20213 min read
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
One-time Donations
I hope I can solve all CCC problems!
bottom of page