Hello.

This round will start Yandex.Algorithm 2011. The problems of the round were prepared by me, of course, with the help of the Codeforces team and Yandex.

I hope you enjoy the problems and their solution will start a successful performance at the tournament.

As you have already noticed — the system operates in a somewhat truncated form. We decided to run it in safe mode and turn off some functionality at the time of the contest. After the round everything will be back.

I recall that the top 500 participants will receive a ticket to the first online round of the Yandex.Algorithm. However, if you do not get to qualify at this time, do not despair — you can participate in the second qualification, which will be held on May 6 at 15:00 (UTC).

I wish you have a fun,

MikeMirzayanov

1) Round will be rated (affects rating).

2) Rules are Codeforces standard rules. Please read them carefully!

3) Also be sure you are registered for the contest! Find yourself here.

4) If you passed this qualification - you can participate 2nd qual. and it also affects your rating.

===

FAQ Раунда:

1) Раунд рейтинговый.

2) Правила: стандартные правила Codeforces, прочитайте их внимательно!

3) Проверьте свою регистрацию на соревнование! Найдите себя здесь.

4) Если Вы квалифицировались в этом раунде - Вы можете участвовать и во втором квалификационном раунде, и он тоже будет для Вас рейтинговым.

P.S.: Мы тут в английской ветке флудим.

This was written in the email which was sent to me about this round, but I see that the registration is closed.

I've got the following error.

-----

-----

So, the server tried to open "tt.py" when the file was named just "tt".

I believe it's not the intended behaviour. Will it be corrected?

UPD: The test is incorrect anyway, so it won't affect the results.

Pretest passed.WAfor this reason is it my problem ??I bet on the left one and got WA . I was dumb enough to not able to think one space will be removed. Though i still don't know what is the correct one from your three choice.

sto ensure the following:"I can not copy paste it here but there is my clarification and the answer:Please broadcast a message about the spaces as if two numbers are separated only by spaces ... exactly one of them should be left - this may refer to numbers.

Answer:to add and remove spacesin the string ... ""3464574575367357<space>4674575368345646835<space>56,...,...,56,456,...,"

So the statement was matter.

You didn't press "Enter" key. The input should end with end of line character. At first I had same problem.

( a1 + a2 + ... + aa ) / a + ( b1 + b2 + ... + bb ) / b

to common divisor

( b * ( a1 + a2 + ... + aa ) + a * ( b1 + b2 + ... + bb ) ) / a*b <= cnst

b * ( a1 + a2 + ... + aa ) + a * ( b1 + b2 + ... + bb ) --> max

then guess that if b > a, then ai sould be >= bi

else if a < b

if a == b we must output 1 1 ... 1 1 2 2 ... 2 2

else if a < b ",can you explain me?

we have a, b and numbers x and y (let x > y)

ax + by - ay - bx = (a-b)(x-y)

x - y > 0, so if a > b and a - b > 0, ax + by - ay - bx > 0

and finally ax + by > ay + bx

S1 / A + S2 / B ->max

S1 + S2 = total sum of all a[i]

if A = B then output 1 1 1 ... 2 2 2

if A > B we need to maximize S2, else S1

if A > B

we need to sort array of marks, S1 = a[1] + a[2] + ...+ a[A], S2 = a[A + 1] + ... a[A + 2] + ... +a[n]

we can count how many marks 1 we must to include in S1, how many marks 2 we must to include in S1..

But I thought it was obvious.

But, it returned correct answer on custom test with input of test 8.

Why did such a thing happen?

Oops. Sorry, I misunderstood interpretation of test result.

Thanks.

Try test:

abc

It's really hard to wake up before 11:00

It'd be nice to have a auto-translate option for comments in non-English. Using Google Translate API maybe.

"Not everybody understands what you are saying here. If using English, maybe we could understand each other better this way."

So you see, just a little in-joke for Chinese speaking people:)

can anyone tell me how to solve the problem E.

although it has tag of tree and dp, but i think it is not a tree, how can we to solve it with tree dp.

Each connected component in the graph has exactly one cycle. Pick any edge from the cycle and remove it from the graph, now we should consider two cases: a picked edge is in the answer and it isn’t there. Both cases can be easily solved with dp on tree.

Hi, can someone give me some hints for problem D? I have got to ask since there is no editorial available. Thanks in advance.