The seventh and final round of COCI 2017/2018 season took place this Saturday at 14:00 UTC and has just finished. As no blog seems to have been created for the contest, let's discuss the problems here now that the contest is over.
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
The seventh and final round of COCI 2017/2018 season took place this Saturday at 14:00 UTC and has just finished. As no blog seems to have been created for the contest, let's discuss the problems here now that the contest is over.
Name |
---|
Results are now available and analysis mode is now open.
How do you access analysis mode? I did not know COCI has this
Click "Submit" when in the contest system.
Would just like to state that problem C had pretty bad testcases, since a very wrong greedy approach (that I used and it seems like many others) got 90 points out of 100 (only 1 testcase counters that approach and it's easy to come up with some).
Aside from that it went pretty bad for me, with a bug on E that cost me 126 points, and a solution to D that I finished 30 seconds before the time was up so I submitted without even testing it (and I had horrible bugs).
On another topic, the only problem I didn't attempt was F. If I understood it correctly, we can merge all bus stops that are on the same line. We can also compute all pairs of distances of a kid and a bus stop. Then we need to assign at most C kids to a line, while having the minimum possible value for the maximal distance a kid needs to go.
So, I suppose we can try doing binary search on the answer. On some iteration with mid, we will remove all pair distances greater than mid, and then we need to check whether a correct assignment exists with the remaining pair distances, though I'm not sure how to do this part.
Anyone who solved F?
The last part is a succession of max flow problems. And a linear seach is enough: you don't have to start from scratch every time, because adding edges to the graph doesn't affect the admissibility of the assignment.
Are there supposed to be bus lines with 0 stops? It seems my solution passes when I remove an assert statement that checked if the bus line had 0 stops.
Problem D (CLICKBAIT): The structure is a rooted tree. Dfs and print ids in postorder.
Problem E (DOSTAVLJAC): DP on tree. dp1[v][i] := max amount of peppers in i units of time from v to any node in v subtree. dp2[v][i] := max amount of peppers in i units of time from v and back to v in v subtree. I think it runs in O(min(N2, N * M2)).
Problem F (PRIGLAVCI): If C * K < N then no solution, print -1. Otherwise, bisection the maximum distance. Maximum flow to detect a valid assignment.
Can you explain the reccurence relations in problem E?
How to solve C?
dp[time][current pokemon][farthest pokemon]
For each state you have a range of pokemon which you have passed, either c...f or f...c. Current pokemon is the one end of the range which you are currently standing at, farthest is the other end of the range which you have passed before.
There are only two transitions, either you continue in the same direction (current changes by 1, farthest stays the same), or else you walk to the other side of the range (current becomes farthes +/- 1, farthest becomes old current).