· Olympiad in Informatics

POJ2891: Strange Way to Express Integers — Solution

Well, for a math scrub like me, writing math problems really is a miserable experience.

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

P1072: Hankson's Interesting Problem — Solution

After reading this solution I AC’d it right away. It really is a very concise approach.

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

BZOJ1257: [CQOI2007] Sum of Remainders — Solution

The expression in this problem can be simplified to:

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

P1108: Buy Low, Buy Lower — Solution

The first question is still pretty easy to answer: use \(O(n^2)\) time to do the DP for the longest decreasing subsequence. For the second question, we can set up an array \(g[]\) to store the number of ways. The transition equation can be derived quite obviously as:

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

P1415: Splitting the Sequence — Solution

The first equation for this problem is actually very obvious, namely \(f[i] = max\{f[i], j\}, number(f[j-1], j-1)<number(j,i)\). The second equation really just restructures the state a bit; it's about the same as the original \(f[]\), with the transition \(dp[i] = max\{dp[i], j\}, number(i,j)<number(j+1, dp[j+1)\). Note that this problem needs a big-integer comparison, otherwise it'll go gg (I spent half an hour debugging this thing).

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

LibreOJ 6003: [24 Network Flow Problems] Magic Balls — Solution

This problem is actually modeled in much the same way as LOJ 6002; it just adds a binary search on the answer to build the graph dynamically. See the code:

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

[Fortuna OJ] Feb 16th – Group B Problem-Solving Report

Idiotic problems, no analysis.

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

[Fortuna OJ] Running Laps — Solution

So godlike.

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

[Fortuna OJ] Three Lines — Solution

This is a problem that leans toward thinking; I guess in the eyes of a big shot it's the kind of problem that gets insta-solved. We can split the three lines into two cases:

Continue reading →Chinese original · English translation by Claude Opus 5.5

· Olympiad in Informatics

[Fortuna OJ] Feb 15th - Group B Problem-Solving Report

A ridiculously easy problem: just do two linear DFS passes and merge the distances.

Continue reading →Chinese original · English translation by Claude Opus 5.5