a bubble cup week

I went back to school this week. I had to study ordinary school studies because of my total flop in NOI2017. GG. I'll try my best to update my blog on time.

Codeforces held the only two contests this week. Round 431 was another Chinese round. As usual, it consists of a hard-to-code data structure problem and some math.

Bubble Cup X ended this week on Sunday evening. Problem H was the most interesting one. Here's the problem statement. Given \(n\) vertices, you need to find \(k\) of them, so that these \(k\) points form a convex polygon without any other vertices inside. \((3\ \leq\ k\ \leq\ min(n,\ 50),\ 3\ \leq\ n\ \leq\ 200)\).

In my last summary, I've mentioned a problem from topcoder. Given \(n\) and \(k\), you need to construct an \(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\)?

Suppose that there could be \(n\ \times\ (k\ -\ 1)\ +\ 2\) distinct integers, then there must be two rows containing at least \(k\) distinct integers. Then, for each column, there could be at most \((k\ -\ 2)\) distinct integers. So in total, there could be \((n\ +\ 2)\ \times\ k\ -\ 2n\). This is less than \(n\ \times\ (k\ -\ 1)\ +\ 2\), so it's impossible.

posted @ 2017-09-04 10:04  King_George  阅读(158)  评论(0)    收藏  举报