This time I've decided to play with spoilers to faciliate the presentation as some of the guys here did before. Tell me what you think about this write-up!
Problem A. Shifts
Topics: dynamic programming.
Summary: the first "hard" problem of the contest. Knowing your basic DP problems helps a lot, but coming up with the precisely correct solution may take a lot of persistence.
Solution: Suppose that we are allowed to make left circular shifts as well as right ones.
Problem B. Number as a gift
Topics: greedy.
Summary: a gatekeeper for inexperienced and/or impatient contestants. Many details to take into account, but otherwise tractable.
Solution: Since we aim to maximize the number, let us look what is the largest first digit we can possibly place. Let d denote the first digit of n.
Problem C. Recursive Generator
Topics: hashing/string algorithms.
Summary: while this is a simple problem, some approaches are better than others in terms of complexity, memory, and implementation tediousness. Pick your poison!
Solution: As a start, how can we prove why the Fibonacci sequence as described in the statement is not 1-recursive?
Problem D. Trading
Topics: greedy, sorting, implementation.
Summary: while the solution is not exactly evident from the start, one has to jumps a lot of hoops and dodge a lot of spikes to avoid all possible mistakes with precision, query limit and whatnot.
Solution:
This pretty much concludes the idea description.
Problem E. Manhattan Walk
Topics: maths, shortest paths in graphs.
Summary: even if you don't come up with a simple mathematical solution, graph algorithms save the day. Easy!
Solution:
Problem F. Tree Game
Topics: game theory, graphs, math.
Summary: frankly, I anticipated a lot more solutions on this problem. All ideas seemed basic to me, and the code is very easy. Still, it seems that cracking it was not easy. Did you enjoy solving it? =)
Solution:
I'll be glad to hear all your opinions in the comments. Thanks for participating!



in the sense that no character occurs more times in
time if we sort the tuples and compare only the adjacent pairs,
time if we hash the tuples beforehand using the
, or
.
with high precision, and then make alterations to it so that the balance is decided on
will be changed by the value of
, which has the same sign as
queries, in practice this number is about 450 on the present constraints.
away from
changes ever so slightly when add practically zero number to it, so that it can dance around
queries, where
.
time.
. It follows that the equivalent game would be to minimize

