☰
成为合作伙伴
博客分类
CP 每周编程挑战
每周发布竞赛编程文章,支持 CCC 练习、问题解决与学生学习成果。
最新文章
包含结构化讲解和实现说明的 CCC 练习文章。
CCC 2018 J5 Choose your own path Solution: BFS for Reachability and the Shortest Ending
☰ 首页北极星学习路径资源文章关于我们联系我们开始北极星测评关闭 首页北极星学习路径资源文章关于我们联系我们 开始北极星测评 CP 每周编程挑战 CCC 2018 J5 Choose your own path Solution: BFS for Reachability and the Shortest Ending Model each page as a vertex and solve both tasks with…
USACO 2019 January Bronze Shell Game Solution: Simulate Every Starting Position
☰ 首页北极星学习路径资源文章关于我们联系我们开始北极星测评关闭 首页北极星学习路径资源文章关于我们联系我们 开始北极星测评 CP 每周编程挑战 USACO 2019 January Bronze Shell Game Solution: Simulate Every Starting Position Track one state variable, simulate all three possible starting shells, and avoid the subtle double-if…
USACO 2019 January Bronze Shell Game Solution: Simulate Every Starting Position
☰ 首页北极星学习路径资源文章关于我们联系我们开始北极星测评关闭 首页北极星学习路径资源文章关于我们联系我们 开始北极星测评 CP 每周编程挑战 USACO 2019 January Bronze Shell Game Solution: Simulate Every Starting Position Track one state variable, simulate all three possible starting shells, and avoid the subtle double-if…
CCC 2013 J5/S3 Chances of Winning Solution: Enumerate Every Remaining Result
Model every unplayed game as a three-way decision, then count all complete futures where the favourite team finishes strictly first.
CCC 2017 J3 Exactly Electrical Solution: Manhattan Distance and Parity
Use Manhattan distance and parity to decide whether the car can reach its destination while using exactly all available charge.
USACO 2020 December Bronze Daisy Chains Solution: Bounded Enumeration with Exact Average Checks
Enumerate every interval, test whether its average is an integer, and check whether that average appears inside the interval.
CCC 2020 S3 Searching for Strings Solution: Sliding Window, Frequency Signature, Set Deduplication
Use a fixed sliding window and a 26-letter frequency signature, then deduplicate matching permutations with a set.
CCC 2017 J5/S3 Nailed It! Solution: Count Pairs per Height with a Frequency Array
Fix each fence height, count complement pairs with a frequency array, and track how many heights tie for the best fence.
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²).