Skip to content

Repository files navigation

CCC

This is a collection of my solution of Canadian Computing Competition (CCC). The solutions are mainly written in C++. Python solutions will be updated gradually.

Analysis

From 2021, I am adding a brief analysis for all problems for how to tackle the problem as a comment at the top of each source code file. Moreover, I am trying to make the variable name more readable, which will make my solution more understandable. I am gradually refactoring the solutions for previous year.

Contributing

Contribution on missing problems, wrong implementation, optimization, simpifying code, and develop a remarkable different solution are more than welcomed. Just send PR and I will be active. Thanks in advance!

Testing

DMOJ

DMOJ has a mirror of CCC grader's test cases on all CCC problems.

My Test Script

  • Quick Usage

Suppose your source file and testing data folder is already on your disk, run the following command with Python 3.6+:

python test.py --src 2020/src/s4.cpp --data 2020/data/s4/ --lang cpp
  • Full usage

See this post, it supports other advanced arguments and testing approach (compare with threshold, test harness file, etc.)

Grade

Here listed the grade judged by myself and DMOJ. Since I don't have a CCC online grader account, I am not able to test on that platform. However, it will be much appreciated to help me test my code on CCC online grader platform.

For Python code It is clearly stated on the CCC official website that the problem is not designed to get full mark on all languages even if an optimal solution is used, that is, for a scripting language like Python, it probably fail on some cases with large dataset. However, a fairly good standing (not heading to CCO or IOI) can still be achieved with pure Python.

2015

Problem #TitleC++PythonNotes
J1Special Day15/15
J2Happy or Sad15/15
J3Rovarspraket15/15
J4Wait Time15/15
J5π-day15/15
S1Zero That Out15/15
S2Jerseys15/15
S3Gates15/15
S4Convex Hull15/15
S5Greedy For Pies15/15

2016

Problem #TitleC++PythonNotes
J1Tournament Selection15/15
J2Magic Squares15/15
J3Hidden Palindrome15/15An adv O(N) solution TBO
J4Arrival Time15/15
J5/S2Tandem Bicycle15/15
S1Ragaman15/15
S3Phonomenal Reviews15/15
S4Combining Riceballs15/15
S5Circle of Life15/15

2017

Problem #TitleC++PythonNotes
J1Quadrant Selection15/15
J2Shifty Sum15/15
J3Exactly Electrical15/15
J4Favourite Times15/15
J5/S3Nailed It!15/15
S1Sum Game15/15
S2High Tide, Low Tide15/15
S4Minimum Cost Flow15/15
S5RMT-/15TBS

2018

Problem #TitleC++PythonNotes
J1Telemarketer or not?15/15
J2Occupy parking15/15
J3Are we there yet?15/15
J4/S2Sunflowers15/15
J5Choose your own path15/15
S1Voronoi Villages15/15
S3RoboThieves15/15
S4Balanced Trees15/15
S5Maximum Strategic Savings15/15

2019

Problem #TitleC++PythonNotes
J1Winning Score15/15
J2Time to Decompress15/15
J3Cold Compress15/15
J4/S1Flipper15/15
J5Rule of Three15/15DMOJ additional data TLE (15/30)
S2Pretty Average Primes15/15
S3Arithmetic Square15/15
S4Tourism15/15
S5Triangle: The Data Structure15/15See v2 for an O(N^2logK) sol to pass DMOJ

2020

Problem #TitleC++PythonNotes
J1Dog Treats15/1515/15
J2Epidemiology15/1515/15
J3Art15/1515/15
J4Cyclic Shifts15/1515/15
J5/S2Escape Room15/1513/15
S1Surmising a Sprinter’s Speed15/1515/15
S3Searching for Strings15/1515/15
S4Swapping Seats15/158/15
S5Josh’s Double Bacon Deluxe15/1515/15

2021

Problem #TitleC++PythonNotes
J1Boiling Water15/15
J2Silent Auction15/15
J3Secret Instructions15/15
J4Arranging Books15/15
J5/S2Modern Art15/15
S1Crazy Fencing15/15
S3Lunch Concert15/15
S4Daily Commute15/15
S5Math Homework15/15

** Notes: TBO: To be optimized
TBS: To be solved

Competitive Programming Resources

YouTube Channel

Some CP YouTuber whose video I am drowning in watching. Good skills will be learnt from their vids.

About

My solution, analysis, and local test script for the Canadian Computing Competition

Topics

Resources

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages