Блог пользователя ch_egor

Автор ch_egor, 8 лет назад, По-русски

Всем привет!

Завтрашний раунд пройдёт в нестандартное время на наборе задач Московской олимпиады школьников по программированию для 6-9 классов. Пусть вас не смущает возраст участников, московская методическая комиссия постаралась отобрать для олимпиады разнообразные и интересные задачи. Непосредственной разработкой задач занимались halin.george, Sehnsucht, cdkrot, vintage_Vlad_Makeev и ch_egor.

Спасибо MikeMirzayanov за прекрасную платформу Codeforces для проведения контестов и замечательную платформу Polygon, значительно упрощающую подготовку задач.

Спасибо V--o_o--V за сокращение официальных легенд задач и перевод их на английский язык.

Надеемся увидеть вас завтра в таблице результатов!

UPD1: Разбалловка 500-1250-1250-1500-2000-2750

UPD2: Наши разработчики очень устали после вчерашней олимпиады, поэтому разбор будет позже. Приносим извинения.

Победители:

Division 2:

  1. zzs_dasc

  2. Kataoka_Yuuki

  3. AkiLotus

  4. tshil

  5. WatchClannad

Division 1 + 2 (unofficial):

  1. uwi

  2. zzs_dasc

  3. fmota

  4. Kataoka_Yuuki

  5. eddy1021

UPD3: Разбор

  • Проголосовать: нравится
  • +253
  • Проголосовать: не нравится

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +29 Проголосовать: не нравится

What a lovely weekend heading up!! :)

Codeforces round 466 and Codechef lunchtime on Saturday and Codeforces round 467 on Sunday.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +42 Проголосовать: не нравится

Perfect time for Chinese users!

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +19 Проголосовать: не нравится

Hope the problems statements are as short as the announcement ! :D

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -99 Проголосовать: не нравится

this is such a bad time for egypt as it will be 11:30 AM

why don't you make it at the usual time as every other contest

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -18 Проголосовать: не нравится

Редкая ситуация, когда я могу поставить плюс анонсу авансом :D

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Chinese users will like it because of the time of the contest~

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +13 Проголосовать: не нравится

Why it's not on the main page?

UPD Now it's ok

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -20 Проголосовать: не нравится

What a short announcement it is!

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -19 Проголосовать: не нравится

Does anyone feel like when there are lot of Chinese participants the round gets harder, because Chinese coders are good?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

How many tasks will be given?

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

What's the main character of this contest?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +15 Проголосовать: не нравится

Perfect time setting for Chinese. Especially just after I finished my Chinese New Year :)

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I was a little bit nervous about next contest after completing DIV2 465. but codeforces is always best... 2 in a row...

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I don't know why tf I posted this comment 7 years ago 😭

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -24 Проголосовать: не нравится

I hope many hacks and high rating

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +24 Проголосовать: не нравится

I hope this contest will make me green !

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +4 Проголосовать: не нравится

The time of this contest is very friendly for China :)

UPD: But seems like the connections is not so friendly,since I'm "500 ERROR" for at least 5 times during the contest... Am I the only one?

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -6 Проголосовать: не нравится

Is this round a replacement of VK Cup Qualification round?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Scoring distribution?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Scoring distribution?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Is this round rated?

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +7 Проголосовать: не нравится

Scoring distribution and Number of problems yet not revealed! Time left to start of contest is 2 hours

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +48 Проголосовать: не нравится

I found this on a market

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -20 Проголосовать: не нравится

Would it be rated for contestants having rating below 1900? As the rating has not been mentioned in the announcement.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

This time isn't so bad for south asian I think ...

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

Here in the U.S. ;)

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

scoring distribution?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

Currently something is going not so right with the Codeforces server...

Let's hope that everything will be okay soon...

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +22 Проголосовать: не нравится

10 minutes with Internal Server Error :(

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +14 Проголосовать: не нравится

Hack page not loading :/

»
8 лет назад, скрыть # |
Rev. 5  
Проголосовать: нравится +21 Проголосовать: не нравится

There's issue with hacking page.

UPD: Round should be declared as Semi-rated so that it is fair enough for all.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +51 Проголосовать: не нравится

Please Don't make the contest unrated.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +26 Проголосовать: не нравится

Will you make this round unrated?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve D ?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
»
8 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

И так весь контест

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

I only have a solution for E when n % c <= sqrt(n). What's the full solution?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve E?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Usual 'connection was reset' and 'try again' later when the contest time will be over.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +24 Проголосовать: не нравится

Is it rated? :-p

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

cf server dropped harder than hardbass beat in my headphones

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

To be fair, Those who their rating change is positive , their contest should be rated, and the other the contest for them should be unrated. :p

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Semi-rated contest time?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Really?! not even extending?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -9 Проголосовать: не нравится

To be fair, Those who their rating change is positive their contest should be rated, and the other's contest should be unrated .

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +34 Проголосовать: не нравится

Come on. Would those last 10 min change that much?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

fast system testing but during the contest codeforces broke down much ):

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Couldn't submit D in the last 3-4 mins. Server issues...

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I did not understand problem (statement) E. Can someone please explain it to me?

  • »
    »
    8 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +5 Проголосовать: не нравится

    statement is quite confusing, but examples are highly helpful to get into it

  • »
    »
    8 лет назад, скрыть # ^ |
    Rev. 5  
    Проголосовать: нравится +7 Проголосовать: не нравится

    I approached this by dynamic programming.

    Let's make dpi the minimum value of the i-length prefix of the array a (1-indexed).

    Also, let's define sum(a, b) and min(a, b), respectively, the total values and the minimum values in the continuous segment [a, b] in the array.

    Initially dpi = 0.

    If i < c, dpi = dpi - 1 + ai.

    Otherwise, dpi = min(dpi - 1 + ai, dpi - c + sum(i - c + 1, i) - min(i - c + 1, i)).

    The sum and min-value of each segment can be calculated in O(logN) time complexity by RMQ-based approaches (I myself used segment trees).

    • »
      »
      »
      8 лет назад, скрыть # ^ |
       
      Проголосовать: нравится +6 Проголосовать: не нравится

      Since range is a sliding window you can do it using multi set.

      • »
        »
        »
        »
        8 лет назад, скрыть # ^ |
         
        Проголосовать: нравится +5 Проголосовать: не нравится

        Thanks for the suggestion :D

        After drafting out the approach, I coded without thinking, and make every calculation as formal (and also universal) as possible :D didn't even think about sliding window actually ;)

    • »
      »
      »
      8 лет назад, скрыть # ^ |
       
      Проголосовать: нравится +2 Проголосовать: не нравится

      How do you prove ur soln works?

      • »
        »
        »
        »
        8 лет назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится 0 Проголосовать: не нравится

        First of all, as the problem itself provides, we can see that no matter how we chose the segments, it will always turn out to be equivalent with a distribution, such as each element is either in a size-1 segment or a size-c segment.

        Secondly, if we merge two adjacent size-c segments together, there may be two cases:

        • If the minimum values of both segments (before merging) are also the 2 minimums of the merged one, the total value of these 2 * c element will remain the same.

        • Otherwise, when one minimum value of one value is higher than an arbitrary element in the other segment (which is not the minimum of that), the 2 minimums now will have the total value lower than that when the segments were separated, therefore, increasing the total value.

        In conclusion, there is no point in merging any adjacent size-c segments.

        Therefore, during the DP process, each element has (at most) two choices: to stand in a size-1 segment, or in a size-c segment with c - 1 elements standing before it (provided there are enough elements).

    • »
      »
      »
      8 лет назад, скрыть # ^ |
       
      Проголосовать: нравится +6 Проголосовать: не нравится

      I think you probably meant

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

If I didn't get fst on C, I would be purple......so sad

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +15 Проголосовать: не нравится

There were glitches in server, but only for short time. I don't think for that round should be unrated. Well, it was first time I submitted all four correctly. I hope, it is rated.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

In the last few minutes of the round submission page was not loading properly. So I could not submit the solution of the third one. Bad luck that the code I was goind to submit for C at last minute was correct indeed. Happened with anyone else??

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +24 Проголосовать: не нравится

why isn't there any announcement whether it is rated or not ?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

can someone please help me! my submission for C (on ideone)

submission of codeforces is going runtime error on case 26!!! why?? can someone tell

the case is

7 5000

qqqqqqq

it works properly on ideone and other places!! i feel its unfair because i could not find anything wrong! please help me, atleast prove me wrong so that i can sleep in peace! thank you!

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

When I handle 'same number' case in D it fails for some reason. Help me to understand why.
AC: http://mirror.codeforces.com/contest/940/submission/35644516
WA: http://mirror.codeforces.com/contest/940/submission/35645618
diff: http://www.mergely.com/sf680QoI/

I understand that I can only decrease r and increase l, but anyway how is it possible that i got WA with those additional checks...

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +183 Проголосовать: не нравится

We encountered a ddos-attack, which affected the round. I'm investigating the impact. If the impact is not fatal, then the round should be rated. Currently I'm sticking to the decision to leave the round rated.

I apologize to the participants who encountered difficulties in submitting solutions. Sorry about it.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +24 Проголосовать: не нравится

Woh! It was a great contest! All problems were interesting to solve! :D

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

i don't know why i wa http://mirror.codeforces.com/contest/940/submission/35646284 who can give me the data?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Same code compiled with C++11 and C++14 made different result.

C++11: Code1 Compilation error (which cost more than 10 minutes)
C++14: Code2 Accepted

Can someone tell me why?

»
8 лет назад, скрыть # |
Rev. 7  
Проголосовать: нравится -21 Проголосовать: не нравится

It seems to me that some of inputs for D were generated in invalid way

AC: http://mirror.codeforces.com/contest/940/submission/35649388
If I add some validation into my submission it fails
RE: http://mirror.codeforces.com/contest/940/submission/35649409

diff: http://www.mergely.com/diBmBHT8/

What I'm validating:
condition ai, ai - 1, ai - 2, ai - 3, ai - 4 > r must be false if current number in b' is 1 and previous 4 numbers were also 1.
condition ai, ai - 1, ai - 2, ai - 3, ai - 4 < l must be false if current number in b' is 0 and previous 4 numbers were also 0.

If at some point we have to increase r or decrease l to hold conditions above, it means that there is a conflict, because on each step we calculate lowest possible r and highest possible l.

Is there a mistake in my logic?

halin.george, Sehnsucht, vintage_Vlad_Makeev, cdkrot, vintage_Vlad_Makeev, ch_egor guys take a look

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

Why rating changes is so long? I spent a lot of time and efforts to solve my first problems. I wrote it in train, where is no Wi-Fi or 4G, I submited it as soon as train arrived at rare stations. I so tired, I need to know what happens with my rating. So this silent expectation makes me crazy!

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Can someone please help me with this on problem E?

I seem to be getting random REs with the same code. All of these codes I just declare some random variables, or increasing array size, so they're practically the same.

My latest submission.

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

My dp in E just missed a line f[i] = max(f[i-1], f[i]); and I got WA.

I actually ignored the truth that f[i] can be equal to f[i-1] which means the i position number is split as a single partition.

Very sad to review the mistake because I lost a quite good opportunity to increase my rating.

»
8 лет назад, скрыть # |
Rev. 8  
Проголосовать: нравится 0 Проголосовать: не нравится

Hi ch_egor!

I'd like to thank you for the exciting competition, but I think there's something wrong with the test case #5 of problem D.

I used assert(minl <= maxl); assert(minr <= maxr); assert(minl <= maxr); to make sure my answer was legal. However, I got an RE at test case #5, see 35641797.

Then I tried to delete those asserts and submitted it 35642151 again, but I was surprised. Not only it passed pretest, but also the system test. I didn't made any change except removing these asserts!

It's good for me that test case #5 is not large (n = 95) and I can copy it all. Finally I found out why.

Here's array a and b at i = 8 (counted from 0):

i:...4 5 6 7 8 ...

a:...94 96 91 98 95 ...

b:...0 0 0 0 0 ...

Now that b[8] = 0 and b[7] = 0, we have r >= 91.

And Here's array a and b at i = 38 (counted from 0):

i:...34 35 36 37 38 ...

a:...62 68 63 64 69 ...

b:...1 1 1 1 0 ...

Now that b[38] = 0 and b[37] = 1, we have r < 62.

So, assert(minr <= maxr) was false and returned an RE. And in fact, this case has no solution.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Why still no rating update yet?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

Is this unrated ????

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Is this unrated ???

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

we want rating we want rating we want rating ho ho ho ho

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

By when will we have the editorial?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Can any one explain problem E to me, or explain the sample case in the statement please ?

The value of some array b of length k is the sum of its elements except for the [k/c] smallest. For example, the value of the array [3, 1, 6, 5, 2] with c = 2 is 3 + 6 + 5 = 14.

»
8 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone explain, why this output is bad? 35663077 I think is it ok.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve F?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Greedy, brute force, implementation all in one!

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

What happened for the people get stared? I didn't realize what I have done bad and I found I was unrated(* Acvator). Also, I found many of the tops are unrated(By get a star in front of it). What happened? Can anybody explain this? http://mirror.codeforces.com/contest/940/standings Many of the Black name's grade are canceled.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится

Что-то в голос с отсылочки к Папичу.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Выйдет ли разбор или нужно самим в интернете искать олимпиаду с её разбором? ch_egor можете пожалуйста уточнить.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

TY for short statements