☰
成为合作伙伴
博客分类
CP 每周编程挑战
每周发布竞赛编程文章,支持 CCC 练习、问题解决与学生学习成果。
最新文章
包含结构化讲解和实现说明的 CCC 练习文章。
CCC 2016 J5/S2 Tandem Bicycle Solution: Sort First, Then Pairing Has Only One Answer
Sort both teams, pair in the same order for the minimum or opposite order for the maximum, and prove why with an exchange argument.
CCC 2023 S2 Symmetric Mountains Solution: Center Expansion for Minimum Asymmetry at Every Length
Fix each odd or even center, expand outward, and find the minimum asymmetry for every crop length in O(N²).
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.
USACO 2018 December Bronze Mixing Milk Solution: Simulating 100 Pours
Learn the USACO 2018 December Bronze Mixing Milk solution with direct simulation, cyclic updates, invariants, and tested Python and C++ code.
CCC 2023 J4/S1 Trianglane 题解:通过统计共用边计算周长
通过周长计算、共用边、奇偶性以及 O(C) 的 Python 和 C++ 解法学习 CCC 2023 J4/S1 Trianglane。
CCC DSA 知识地图:从 Junior 到 Senior 的数据结构与算法
从 CCC Junior 到 Senior 的数据结构与算法路线图,涵盖模拟、字符串、网格、计数、前缀和、图搜索、贪心、并查集、最短路、动态规划及典型历史题。
CCC 2017 S1 Sum Game 题解:运行前缀和与最后一次平局
学习如何用运行前缀和、累计总和与最后有效位置跟踪,在 Python 和 C++ 中解决 Sum Game。
CCC 2020 J5/S2 Escape Room 题解:隐式图上的 BFS
学习使用隐式图上的 BFS、乘积到格子的索引和已访问数值优化,用 Python 与 C++ 解决 Escape Room。
CCC 2021 J5/S2 Modern Art 题解:用奇偶性统计金色格子
学习利用奇偶性、行列翻转和 O(M + N + K) 的计数公式,用 Python 与 C++ 解决 Modern Art。
CCC 2025 J4 Sunny Days 题解:一次修正,最长连续晴天
用 prefix/suffix 连续计数理解一次修正,处理最长连续晴天、全是 S 的特殊情况,并写出 Python/C++ 解法。