Overslept before the contest and cannot join the contest on time.
The number in the bracket is the order of attempt.
Sorting String (1st, solved)
The first problem attempted in the contest. Somehow guessed that doesn't matter (it doesn't), and just check whether the multiset of characters in and are the same.
Rough idea of proof that doesn't matter:
Swap the first two elements times. Then to swap two adjacent elements, swap them times so the total number of swaps is not changed.
2D reverse (3rd, solved)
This should be the easiest question in the contest, but I wasted some time as I misread the problem (I mixed up the final and the intermediate state). Also spent some time trying to figure out which is 列 and which is 行.
麻布動物園 (5th, solved)
While attempting this problem I had 2 wrong hypotheses:
- For each edge built, merge the two nodes in a DSU. Output the number of disjoint sets.
- For each edge built, built a edge on graph from from the higher to lower node. When the nodes are of equal height, build a pair of edges between them. Output the number of nodes with indegree .
The second hypotheses is almost right: instead of building a pair of edges between them, merge the two nodes in a DSU. The problem is then solved.
Text Editor (2nd, solved)
This problem seems the most direct problem in the contest so I attempted this after finishing Sorting String.
I implemented a doubly linked list, using the C++ idea of pointers (i.e. adding a null element at the end). It took about 40 lines of code (and I ignored the dangling pointers).
Just after finishing this problem, I realized this problem can be solved using two stacks much more easily. Just store the characters on the left of the cursor in one stack and the characters on the right of the cursor in another.
ビル跳び (4th, 40%)
The first idea that come to my mind is dynamic programming, but then I looked at the scoreboard (nobody scored more than 40) and the constraints for subtasks 1 and 2 (), and realized that it can be done by Floyd-Warshall algorithm. Total complexity .
Tried to look at subtask 3 and 4 to derive a solution, but could not think of a solution more efficient then .