My last two-month training before NOI(Chinese National Olympiad of Informatics)

Revision en9, by King_George, 2017-05-12 03:40:43

Just several hours ago, JSOI2017(the selection contest in my province) ended, and I ended up with rank 5. Finally, I could go to NOI(Chinese National Olympiad of Informatics, more details can be found here), which will be held in July. Although rank 5 is pretty good, there's still a wide gap between top 4 and me(congrats to the top 4 who may get a 5-point bonus in NOI). This means I have to learn more and train harder, so here comes the post. In this post, I'm gonna record my daily training and contests during the last two and a half months. I hope keeping updating will push me to train harder and also improve my English in the same time. The problems mentioned here may be easier than those mentioned in matthew99's and Petr's blog, but I'll do my best to make this post great. Hope you may like it. :)

Codeforces Round #411 will start in less than one hour. I'll make my first record after it. Wish everyone good luck.

My performance in the contest was a complete flop. I was too sleepy to code problem C and D, though they were not too difficult. I was exhausted after the two-day provincial-team-selecting contest. Maybe all I need now is just a good rest. I will solve the problems left in the contest after that and share with you later.

May 6th

I solved problem B of Petr Mitrichev Contest 1. The problem is not too difficult. The key is that if we know the value of A(1, j) and A(i, 1), then we can calculate all A(i, j). Then the problem becomes whether there exists some values of A(1, j) and A(i, 1) such that all A(i, j) is between 0 and 1. For two elements A(i, 1) and A(1, j), we have some limits that it's impossible for A(i, 1) = x and A(1, j) = y simultaneously. So the problem becomes a 2-SAT.

In the evening, I took part in Atcoder Grand Contest 014, which was another flop to me. The problems are a little bit easier than usual, and there was a data structure problem. However, I still just solved 4 problems. I couldn't focus when coding, and as a result I made some stupid mistakes when coding C and D. I tried to solve problem E after that, and my performance on E was just shit. After having an idea, I hurried to code. Still, I made a lot of mistakes when coding, and couldn't accept it in time. After the contest, I tried a lot of times before accepting it. I found that both my ideas and implementation were wrong. As a Chinese OIer, I couldn't solve this data structure problem. What a shame!

After JSOI and AGC014, I noticed that I'm now having a big problem of coding. I always made some small mistakes such as typo when coding, and often need a lot of debugging to get accept. I should try to focus on my code when coding, and train more problems which are difficult to implement. Have you once had the same problem? And how do you avoid making stupid mistakes when coding?

May 7th

I took part in topcoder SRM714 and codeforces #412, and plan to solve left problems several days later.

May 8th

May 9th

I solved problems from APIO2014. They are much easier than those of last year. 'Beads and wires' is the most interesting one I think. First, you need to find how the blue wires will be like. When choosing a root, all blue wires will consist of the parent of parent, the parent and the node. This can be done by dp. I spent some time on coding. My code was pretty long and ugly. Some part of my code is almost the same, and it appears again and again slightly different every time. I'm wondering if there's some efficient way to code tree-dp problems, where you need to store the maximum and second maximum of four or more dp values.

May 10th

I tried to solve UOJ204 Boat from APIO2016. It's a dp problem. First you need to discretize the number of boats, and then do a interval dp. My dp status is dp[i][j][k], which means till the i-th school, there're k schools sending x boats, where x lies in the j-th interval. I think it's a little bit tricky to use the status k, as there're C(B, k) / k! ways choosing k numbers from the j-th interval(B is the total number of numbers in the j-th interval). Using prefix sums, it can be done in O(N3). However it got time limited exceeded. I squeezed my code for some times, and it still couldn't pass the fourth subtask. I saw some other submissions with similar complexity passes, and matthew99 solved it with FFT. Maybe I'll think about it later.

APIO2017(China Region) event will begin tomorrow. I'll go to Beijing tomorrow morning. Wish everyone who is gonna to join it good luck.

May 11th

Arrived in Beijing. I solved UOJ110 Bali Sculptures and CF773D Perishable Roads, and thought about the other two problems from APIO2015. Among these problems, I thought UOJ111 Jakarta Skyscrapers is the most interesting one. First, you can come up with a pretty straightforward solution, dijkstra. Next, you need to use the small-big trick. For a doge with a large p value, just add edges to all skyscrapers it can reach, as the number of edges is n / p. For every skyscraper, build some new nodes v1, v2, ..., vp. Then, you just need to add edges between neighbouring skyscrapers for small p. Adding edges only between neighbouring vertexes, I pretty like this trick. Sometimes, changing your graph a little bit, maybe there comes a correct solution.

May 12th Participated in Codeforces Round #413. My performance was good, but still not perfect. After solving the first four problems, I opened problem E. Came up with a straightforward solution which required treap. Then looked at standings, few people solved it, so just began to code immediately. Made some mistakes both in treap and main part, but avoided FST. I should think twice before coding next time. From this contest and AGC014, I found that I'm now having a big problem of coding. Spent too much time on data structures, and had some unsuccessful tries in both rounds. I should keep pressure on coding and keep solving data structures problems in my following training.

#### History

Revisions

Rev. Lang. By When Δ Comment
en17 King_George 2017-05-22 06:30:20 478
en16 King_George 2017-05-21 02:55:23 272
en15 King_George 2017-05-19 16:01:52 208
en14 King_George 2017-05-18 16:29:53 344 (published)
en13 King_George 2017-05-18 04:52:55 98 (saved to drafts)
en12 King_George 2017-05-17 16:53:38 2347
en11 King_George 2017-05-15 19:28:54 2005 Tiny change: 'ting at \$j\$(i < j <= ' -> 'ting at \$j(i < j <= '
en10 King_George 2017-05-14 15:24:14 1021
en9 King_George 2017-05-12 03:40:43 691
en8 King_George 2017-05-11 17:21:55 893
en7 King_George 2017-05-10 13:15:57 975 Tiny change: '99] using _**FFT**_' -> '99] using **FFT**__'
en6 King_George 2017-05-09 17:27:12 666
en5 King_George 2017-05-08 04:38:46 122
en4 King_George 2017-05-07 04:00:11 1099
en3 King_George 2017-05-06 12:17:44 540 Tiny change: '1, j) = y\$. So the p' -> '1, j) = y\$ simultaneously. So the p'
en2 King_George 2017-05-05 08:53:34 326
en1 King_George 2017-05-04 16:48:01 1088 Initial revision (published)