Codeforces Round 394 screen cast by eddy1021
First contest after Chinese new year!
Solved A, B, C, D in about 20 mins. A is set to be hacked. However, I was too late to start hacking.
E is a construction problem. Given a tree with 30 vertices, you should put it on a plane s.t. every vertex is on integer coordinate and every edge is a straight segment without overlapping with other edge.
The constraint is very weak. Thus, just divide and conquer it. Apparently, if any one vertex has more than 4 edge, it's impossible. Otherwise, the solution always exists.
F doesn't look like F. Given a N*M table consists of a-z, k tables can be generated from it by replace subtable ((ai,bi),(ci,di)) to character ei. You should find a table among those k tables s.t. the total distance from it to others is minimum. The distance is defined as sum of the difference of each entry.
We can sum up the number of times of a to z for each entry. Then, we can first calculate out the distance of original table to those k tables. For each k table, we can recalculate the cost among that subtable easily.
Rank 1 on final standing. Hope to keep going up this year!
No comments:
Post a Comment