By RAD, 11 years ago, translation,
Hi everybody

Today the author of the majority of problems is Dmitry Zhukov, many thanks to him for this.
Also I want to thank Mike Mirzayanov for choosing problems for the contest and organizing it and Julia Satushina for the translation of the statements.

Good luck!

UPD:
Announcement of Codeforces Beta Round #23

• +25

 11 years ago, # |   0 registrations closed!! nice! bye... next time!
 11 years ago, # |   +5 Can somebody explain why the answer to B is max(0, n-2)? Or suggest a reference I can read about it...
•  11 years ago, # ^ |   +4 Find out with tests and you'll see the solution of task B.
•  11 years ago, # ^ |   +1 You can do some simple Math proof. Prove that it's impossible to have n or n - 1 people left. With n - 2, we can single out 2 people (these 2 guys dont know each other) and put the rest into a group where each member knows each other and knows the 2 isolated guys. It's each that this arrangement satisfies the conditions of the problem.
•  11 years ago, # ^ |   0 My typo: " It's easy to prove that this arrangement satisfies the conditions of the problem."
•  11 years ago, # ^ |   0 Consider the reduction where friendships make a graph. We start by deleting all nodes of degree 0, then 1, etc.This is how you can construct a graph that has n-2 left:First, make a perfect graph of n-2 verticies. (i.e. a connected graph where each node connects to every other node). Now, make 2 more nodes, and connect them to all of the nodes of the perfect graph. Now, our two nodes have degree n-2, and our perfect graph of size n-2 has degree n-2. When we remove all nodes of degree 0 - n-2, nothing happens. When remove the nodes of degree n-2, we get rid of the 2 nodes we added, and every node in the perfect graph drops a degree to n-2, since they are gone!Since they are degree n-2, and we just considered n-2, they will all survive.So we can make n-2.
 11 years ago, # |   0 @:Shuaib: The is a algorithm as following-First , construct a full graph .-Then  remove a random Edge from the current graph . Two vertices of this edge have a degree of n-2, and the remaining edges have a  (n-1)-degree.  So we have the answer.
 11 years ago, # |   +3 Any idea about Problem C?
•  11 years ago, # ^ |   0 From what I've seen in the solutions, it's enough to consider all subgroups of n contiguous boxes, wrapping around. However, I have no idea why it's correct, maybe it's related with the fact that there is always an answer.
•  11 years ago, # ^ |   +7 If there is a pair i, j such that a[i] >= a[j] and o[i] >= o[j], we should choose the i-th box and not to choose the j-th box, and then we can solve the problem for (N - 1). Otherwise sort the boxes and get a[1] < a[2] < ... < a[2*N-1] and o[1] > o[2] > ... > o[2*N-1]. Choose boxes 1, 3, 5, ..., 2*N - 1.
•  11 years ago, # ^ |   0 how to prove this method can satisfy the condition in the problem? it's really hard for me to think such a solution....
•  11 years ago, # ^ |   +1 When we pick numbers with odd indexes in a sorted sequence, their sum is always more than half the sum of all numbers in the sequence.Reasoning =>Lets remove A[1], We know thatA[3] > A[2], A[5] > A[4], ......, A[2*N - 1] > A[2*N - 2]We're adding the greater sides from all these inequalities soA[3] + A[5] + ... + A[2*N - 1] > A[2] + A[4] + ...... + A[2*N - 2]Adding A[1] on the bigger side doesn't hurt :-) SoA[1] + A[3] + ........... + A[2*N - 1] > A[2] + A[4] + ......... + A[2*N - 1].Similarly we can prove the same for the sequence O as well (looking at it in reverse order).
•  11 years ago, # ^ |   0 nice explanation.
 11 years ago, # |   0 sigh , I was trapped in Problem B for a long timeIt seems so hard for me!!!
 11 years ago, # |   0 Why this code always gets "Presentation error test 1" ?Code hereI rewrote my solution from C# program, which passed all tests.
•  11 years ago, # ^ |   0 Потому что Input.txt и Output.txt?
•  11 years ago, # ^ |   0 Забыл кстати упомянуть, что задача А и нет, дело не в файлах... там же стоит #ifdef и поэтому читается и пишется в консоль.Да и вообще я этот шаблон уже использовал и сдавал на F# задачи раньше тут, а эта задача чего-то уперлась и не хочет проходить.
 11 years ago, # |   +5 In my opinion tasks weren't chosen reasonably. Only 30 people solved more than two. I think that contestants should be classified by number of problems solved rather than the time. First two tasks were ok, but it would  be better if third task was solved by 60-80 people, fourth by 15-30 and  fifth was extremely difficult. In this contest all three tasks were almost at the same level of difficulty.
•  11 years ago, # ^ |   0 Well , I think problems must be difficult like this. The another div 2 - contests  have  easier problems .
•  11 years ago, # ^ |   +2 Time is limited!
 11 years ago, # |   +1 Brilliant problems. I love problem C. But couldn't anything have been done so that the solutions that choose randomly n boxes and check if they are good and repeat this until they get a solution aren't accepted?
•  11 years ago, # ^ |   0 Consider this data:1 01 0... (amount : n - 1)0 10 1... (amount : n)It can be calculated that the probably of get a possible answer is O(1 / sqrt(N))So the random algorithm 's expect time complexity is O(N sqrt(N))But we have the O(N logN) algorithm.We can make large data  , the random solution will get TLE.
 11 years ago, # |   0 Problem D seems so hard for me. I just can't solve this one.can you give me some tips?
•  11 years ago, # ^ |   0 Try this link: http://codeforces.com/blog/entry/530
•  10 years ago, # ^ |   0 I have another solution that got accepted. It is a little bit more connected to algorithms than applying some geometry observations:Lets number the midpoints 0, 1 and 2 and assume that 0 is the midpoint of the side that is equal to both of its neighbors. We know that we have a polygon vertex lying on the symetral  of 0, 1. I do binary search for this point A. For each candidate I do symmetry according to 0 and thus get point B. I have made the obvious observation that initially the points on the symetral of 0, 1 give us points B that are further away from 2 than 0, and then they become closer to 2. we are in fact interested in the moment in which the distances to 0 and 2 get equal. This allows us to make binary search. After we finish the binary we have two of the vertices of our polygon. What is left is to do 2 more symmetries and check whether the obtained polygon complies to all requirements. As a final note - in the beginning we assumed 0 is the center of the mid equal segment but in fact every of the three vertices can be that one. So we need to try all three possibilities to make sure no solution exists.
 11 years ago, # |   0 That's something wrong with the judge. I've got "Judgement failed".
 11 years ago, # |   0 IMHO problem D has some troubles with precision.After decreasing epsilon (used in vector product checking) from 1e-11 to 1e-9 solution was accepted...