CCC 2022 J4/S2 Group Work Solution: Count Violated Constraints in One Pass with a Dictionary
Map each name to its group with a dictionary, then count every violated constraint in two linear passes, with Python and C++ solutions.
Weekly competitive programming and CCC practice articles.
Map each name to its group with a dictionary, then count every violated constraint in two linear passes, with Python and C++ solutions.
Learn the USACO 2018 December Bronze Mixing Milk solution with direct simulation, cyclic updates, invariants, and tested Python and C++ code.
Learn CCC 2023 J4/S1 Trianglane with perimeter counting, shared edges, parity, and O(C) Python and C++ solutions.
A CCC DSA roadmap from Junior to Senior, covering simulation, strings, grids, counting, prefix sums, graph search, greedy, DSU, shortest paths, dynamic programming, and typical historical CCC problems.
Learn how to solve Sum Game with running prefix sums, cumulative totals, and last-valid-position tracking in Python and C++.
Learn how to solve Escape Room with BFS on an implicit graph, product-to-cells indexing, and visited-value optimization in Python and C++.
Learn how to solve Modern Art with parity, row and column toggling, and an O(M + N + K) counting formula in Python and C++.
Learn how to solve Sunny Days with prefix and suffix streak counts, one-day correction logic, and Python/C++ implementations.
Use sparse tree coordinates, candidate top-left corners, and careful shrinking to find the largest empty square.
Use grid search, direction vectors, and one right-angle bend to count every hidden occurrence of a word.