a decomposition week
There were plenty of contests this week. Multi-University Training Contest rounds 7 and 8 went on as usual on Tuesday and Thursday. Then Astar was held on Friday afternoon. A few hours later, Codeforces held #429. On Sunday evening, hihocoder challenge 30 ended up the busy week.
Multi-University Training Contest R7: I solved problems 1002, 1005, 1006 and 1007. As problemsetters once showed me problem 1013, I got the first blood of it using the official solution.
Multi-University Training Contest R8: As my teammates couldn't participate, I finally had the opportunity to be a teammate of gao_r_q, top 10 in UOJ. He showed his excellent problem-solving skills and carried us by solving the most tricky problem 1007 and successfully trade problem 1004 for problem 1001 in the last hour.
Astar: There were still some bugs in problem statements. After misunderstanding the meaning of one problem because of that, I gave up in the last hour. rqgao2014 got a ticket to the Finals. Congratulations!
Codeforces #429: After reading the statement of problem E, I tried to come up with a solution but failed. Then I solved the others before system testing. However, my solution to problem D got TLE because of choosing an unsuitable bucket size. At last, I ranked 102 and dropped to GM. Problem E was quite an interesting problem of DS. Here's what the problem looks like. You're given a tree with \(n\) nodes, rooting at \(1\). There's a value \(a\) for each node. Then you're given \(q\) queries. Each one gives you two nodes \(u\) and \(v\), which guaranteed that \(u\) is an ancestor of \(v\). You need to find the maximum value of \(a[w]\ xor\ dist(w, v)\) where \(w\) is on the path from \(u\) to \(v\).\((1\ \leq\ a[i],\ n\ \leq\ 50000,\ 1\ \leq\ q\ \leq\ 150000)\)
Hihocoder Challenge 30: After quickly solving problem A, I messed up problem B, and had no time to solve others. Luckily, the other two problems were too hard for participants to solve. I still got a small prize.
In my last summary, I mentioned a problem from GCJ WF2017. Here's the problem statement. Given \(K\), you need to construct a graph with no more than \(22\) vertexes and without self loops which contains \(K\) spanning trees.\((3\ \leq\ K\ \leq\ 10000)\). It's guaranteed that at least one graph exists under the conditions.
After some tries, one may find out that it seems impossible to solve it by construction-based solutions. In fact, it's a problem about searching. One can obtain graphs with more spanning trees by adding edges. However, there're a lot of graphs. I used the method which only add edges to a graph which the number of spanning trees of it hasn't appear before. It can get all the answers. However, I can't prove the correctness of it. Can you prove it? Do you use different methods? Feel free to discuss.

浙公网安备 33010602011771号