top of page
Search
CCC 2021 S3 Lunch Concert
#include <iostream> #include <stack> #include <cmath> #include <string.h> #include <algorithm> #include <stack> #include <vector>...
Oct 9, 20241 min read
CCC '23 S2 - Symmetric Mountains
#include  <iostream> #include  <vector> int  main (){ long  long  N; std :: cin >>  N; std :: vector < long  long >  mins (N +  ...
Oct 3, 20242 min read
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 '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
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 '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 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 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 '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
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 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
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
One-time Donations
I hope I can solve all CCC problems!
bottom of page