Welcome, friends)

We are glad to introduce you regular Codeforces round #130 for Div.2 participants. Everyone can traditionally participate in it. There were some problems with registration of Div.1 participants, but now everything is alright)

Problems are prepared by command of authors: Pavel Kholkin (HolkinPV), Nikolay Kuznetsov (NALP) and Gerald Agapov (Gerald). Traditionally thanks to Michael Mirzayanov (MikeMirzayanov) for perfect Codeforces system and Mary Belova (Delinur) for translating problems. Also thanks to Alexander Kouprin (Alex_KPR) and Pavel Kunyavskiy (kuniavski) for their help.

And again score distribution will be dynamic) More information you can find here.

Note that all problems will be given in random order.

We wish you good luck, successful hacks and high rating!

**UPD**: the contest is over, no matter what, we hope you enjoyed the competition

**UPD2**: The authors apologize for the situation with the problem E. The problem has affected a small number of participants from div2 (22 participants) and the solution of original version of the problem doesn’t differ a lot (in most solutions is sufficient to remove a couple of lines, solutions become more simple). Therefore, it was adopted the following decision:

- for all 22 participants,who has problems with problem E and will have decrease of rating, the round is unrated.
- for everybody else the round is rated

**UPD3**: after recalculation it was found that there are 20 such participants, not 22

**UPD4**: unsuccessful hacks, which answers differed from the correct whitespaces, are decided to ignore

**UPD5**: tutorial can be found here

Will it be dynamic scoring.?? If not what is the score distribution??

According to russian version of post — yes, it will.

hacked by hackers

Are you going to make all contests in future with dynamic score system? Or you just making experiments?

Is there anything bad with it?!

Yeah, I think this system need a lot of improvement, and now it looks very poor and unfair. Excuse me, developers, but it's my own opinion.

My feeling is that in dynamic scoring system there is not so many points distributed (I have no statistic for this, just a feeling)... And so, the coders' rating is decreasing for most of them :-(

I think it would be better if it's smoother (as discussed in comments on dynamic scoring blog).

On the other hand I like these dynamic scoring rounds, because you do not know the final score until the very end of the contest (system tests).

GOOD LUCK

How to judge Problem A? I've found a solution which generate "WE ARE THE CHAMPIONS MY FRIEND " for the second example.

There are two spaces between ARE and THE, but it's still right. Is this a mistake? Or some other reason?

As per as I have found. Cf checks answers by tokenizing them. So whitespaces doesn't matter unless it is explicity mentioned as in some questions.

Ah... thanks... Kind of unhappy :( I spent 20 minutes and hacked nobody...

We have removed all such unsuccessful hacks.

Instead of just removing the unsuccessful hacks, people with the incorrect answer (differing in number and position of spaces) should have failed system test. As I mentioned earlier, many of the contestants may have put in additional time to get the right answer.

Why my hack was wrong?

My attempt was like: WUBWUB...A, the expected answer is "A", the other guy solution prints " A" :/

Just like what i said above... That's very intetesting... i think the judge regard space as nothing...

You just got trolled by codeforces, they ignore white spaces.

i think the judger ignores all blanks, but i don't know if it is right

Then the problem statement should be: "Separate the words with one or more space."

I also lost points for unsuccessful hacks for similar cases. Also, I took much longer time to code and test for such cases during my submission. This way of evaluation is really unfair.

We have removed all such unsuccessful hacks.

Can anybody give me hint for problem B ? My code fail in preetest 9 :(

My solution too.

The state you use in your DP is described by the variable "sekarang", shouldn't the state also contain the last pile values? (int memo[100][52][52][52] instead of int memo[100] ...)

Well yeah, you were right. I missed it :(

This contest should be unrated. Before you change the statement of problem E it's impossible to AC

I partly agree with you, after the change of the statement , there was not enough time to solve it.

There exists a solution for both versions, which differs by only one line. But I also think the round should be unrated.

But it'd be unfair for those, who have spent almost two weeks in Div2 after the previous round and now have real chances to return back to Div1.

You're right, to solve the previous problem you just need to do a subtract operation. It's not so good to change statement in the last few minutes.

Another reason to make it unrated is that CF added 10 minutes to coding phase. It's true that system failed for ten minutes but it was 10 minutes of time to code and think for some others and in my opinion it's unfair. Let's wait and watch what they will do! :)

Can I have the time that the editorial be posted?

I solved it by DFS order and functionnal segment tree. First we get the DFS order in O(N) time Then we get the k-parent in O(logN) per query(by the same method like LCA) Now we should solve a interval question : how many Di in L..R It can be solved by functional segment tree easily

How can some competitors solve problem E at their first attempt before the announcement?

Way to solve problem E:

I think this is a quick response to announcement contest, nice style :)

Hello, can you tell me how to solve problem E?

What is the wrong way to understand problem E? I didn't find the statement ambiguous and solved it.

At first statement suggested that for test

answer is 0 (as 4 and 3 are 1-brothers and not 2-brothers)

Why

Compilation Erroris counted as -50?Please, give an example.

In this round I get -50 for this: http://codeforces.com/contest/208/submission/1924772

In final standings near my result for this problem is "+1" (after CE, I resubmit & got AC)

You have 486 for problem D. What is wrong?

Ups, my bad. Sorry

Please help me out ! I'm new to codeforces enviroment. My solution id is 1931589 and want to know the full test case for which I got runtime error or bug in my solution ?

Thanks

I believe you can't view the full test case because it's too large, you can only see part of it.

hacked by hackers

thanks lashabuxo also i interesed this +1

I am wondering, if on this submission: http://codeforces.com/contest/208/submission/1925102 I saw the error, it should give runtime error, is there a chance that I try to hack it and it should result in runtime error and it does not? (I dont know how exactly runtime errors are thrown on windows..)

Excuse me. . Can you update this blog so we can know this round will be rated or not ?

These problem was well designed.

Hi guys!

After reading the description of problem B, I was not quite sure about one part of the statement. After shifting one pile x onto another one (x-1 or x-3), is pile x effectively removed? in other words, are all piles renumbered after each move? still not clear to me after reading the statement several times.

Either way, I dont understand pretest 5: 7S 7S 4S 8H 4H (its answer is supposed to be "NO")

Assuming piles are removed: 7S 7S 4S 8H 4H => 7S 4S 8H 4H => 4S 8H 4H => 4S 4H => 4H.

Assuming piles are not removed: 7S 7S 4S 8H 4H => 7S 4S 00 8H 4H => 4S 00 00 8H 4H => 4S 00 00 4H 00 => 4H 00 00 00 00

So... I just dont get what I'm doing wrong here, in my opinion the answer should be "YES". Could someone enlighten me? Thanks!! :]

PS: Great contest, was fun... Thanks for you work guys!!

`x`

is always last. So, it's removed, but nothing renumberedWow. I understand it now, this statement mislead me big-time: "During one move, a player can take the whole pile with the maximum number x (that is the rightmost of remaining) and ..."

It totally sounded to me as if the maximum number of the pile to be put onto another one is x (of course, rightmost one)... and assumed every pile starting with pile 2 can be put on ones before. Not sure if this was intended challenge.

A more obvious statement wld have been: The pile x, whereas x is the maximum possible value and therefore represents the rightmost pile, can then be put on...

Firstly, I had the same idea as you, but then I've reread the statement, it goes "Let's number the piles from left to right, from 1 to x", further explaining what one can do with pile x.

Yes, you are certainly right. The statement is definitely correct. It could just be written in a way the intent is more obvious. ;)

Hi, When the editorial will be available?

There is russain one

2:20 AM here and still wait for ratting

Sorry for the off — topic question, but I couldn't find any information about virtual participation. How can I join for a virtual competition, and will it be rated or less?

Read this.

Thanks for the link.

hacked by hackers

Is there any solutions about this contest?

You should have read this first before commenting

hacked by hackers

thanks

Why Codeforces English Version is not so updated like Russian version? In Russian version, problem-set analysis is already given, but in English version its not up yet.

google translate is making me sick..

:(

It's only the problemsetter's blame. When you're preparing contest (It takes at least several days!) you can easily find 30 minutes to write and translate analysis to English. When I was author, for me it seemed something necessary and obvious, and I don't understand, why such delays happen.

hacked by hackers

I am new on codeforces.com and how add friend??

hacked by hackers

Codeforces Round №**130** contest duration was also

130(02h 10m=2*60+10=130m) :)There is something wrong about problem E Blood Cousins.

Look this .

If input is:

3

2 0 2

1

1 1

Output should be 1,but this code will output 0.

What you said is actually right.