a pigeonhole principle week

HDU held the last two rounds of MultiUniversity Training this week. I participated Round 9 with team 248. Almost all problems required lots of coding. Problem 1006 was the most interesting one. It requires a technique which I had never met before.

On Thursday evening, Topcoder held its SRM720. Median is simple to get a solution but hard to prove. Here's the problem. Given \(n\) and \(k\), you need to construct a \(n \times n\) grid of integers where each row and column has at most \(k\) distinct integers. The returned grid must have the maximum number of distinct integers. \((1\ \leq\ k\ \leq\ \frac{n}{2})\). Can you prove the maximum answer is \(n\ \times\ (k\ -\ 1)\ +\ 1\)?

This week ended up with AGC019, a tourist's round. After messing up problem D, I switched to problem F. However, I failed to come up with the solution. When the contest was going to the end, rqgao2014 told me that problem E was pretty easy. Thanks to his help, I ranked 35 in the end.

In my last summary, I've mentioned a problem from CF. The key to it is binary representation. Tree has almost nothing to do with the solution. We can find out that the answer is always a 16-bit number. So, we can divide a query chain into small chains, sizes of which are less than 256. Then we can run brute force on each node.

posted @ 2017-08-27 19:11  King_George  阅读(151)  评论(0)    收藏  举报