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

Привет, Codeforces!

В Jun/10/2018 13:05 (Moscow time) состоится Educational Codeforces Round 45.

Продолжается серия образовательных раундов в рамках инициативы Harbour.Space University! Подробности о сотрудничестве Harbour.Space University и Codeforces можно прочитать в посте.

Этот раунд будет рейтинговым для участников с рейтингом менее 2100. Соревнование будет проводиться по немного расширенным правилам ACM ICPC. После окончания раунда будет период времени длительностью в 12 часов, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 7 задач на 2 часа. Мы надеемся, что вам они покажутся интересными.

Задачи вместе со мной придумывали и готовили Адилбек adedalic Далабаев, Роман Roms Глазов, Иван BledDest Андросов и Михаил MikeMirzayanov Мирзаянов.

Удачи в раунде! Успешных решений!

Поздравляем победителей:

Место Участник Задач решено Штраф
1 KrK 7 225
2 isaf27 7 231
3 BigBag 7 325
4 Motarack 7 327
5 TangentDay 7 331

Поздравляем лучших взломщиков:

Место Участник Число взломов
1 halyavin 202:-52
2 2014CAIS01 26:-2
3 djm03178 20
4 bitcoin 19
5 antguz 25:-17
Было сделано 549 успешных и 525 неудачных взломов.

И, наконец, поздравляем людей, отправивших первое полное решение по задаче:

Задача Участник Штраф
A tzuyu_chou 0:01
B DoomzGay 0:05
C 562225807 0:08
D teja349 0:12
E eddy1021 0:18
F nhho 0:45
G AChen142857 0:14

UPD: Разбор опубликован

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

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

Good luck to all!

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

Starts at unusual time :)

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

Welcome back BledDest!

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

During 20:00-20:05(BJS), I have my left hand on a computer that open Codeforces, and my right hand on a computer that open Atcoder.

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

Sometimes only for unusual time many regular participants can not participate...!!!

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

Thank MikeMirzayanov for codeforces and polygon platform. :)

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

Tester halyavin haven't registered yet)

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

Is it rated for Div. 3 then?

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

Finally, a contest after more than a week of non-practicing :D

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

Contests with hacking phase make me nervous before even participating.

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

The one in which solution can be hacked on some base cases rather than edge cases :: Educational round.
So, think 4 times before submitting

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

Done with semesters finally!! Wishing higher ratings to everyone including myself :P

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

For me, it is first time contest starts in reasonable time zone. (19:05 KST) I was struggle on midnight-beginning contest heretofore :)

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

float ship; // must be a float otherwise ship sinks

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

I couldn't help but notice that people with rating >= 2100 are not marked as out of competition.

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

This time is friendly for Chinese!

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

Can someone explain what are the extended ACM ICPC rules? In what do they differ from the regular ACM ICPC?

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

For problem D.. the only "NO" testcase is n > 1 and b > 1 .. is this true ?

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

I wonder what's the matter with problem D?

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

Give me some strong test case for problem C

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

What's the 3rd test case for problem D?

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

Can anyone tell me how many points will I get for successful hack and how many I will lose for an unsuccessful one?

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

User Fortza_Gabi_Tulba submitted F(39097227) at 00:28, and submitted E(39097570) at 00:29.

Since it is (almost) impossible for human to solve and code problem F in only one minute,

does it mean he submitted problem F while coding problem E?

Or he coded E and F, and then submitted F and E?

Or, is he a genius?

same thing for problem B(39091953) and D(39092747)...

I doubt if Fortza_Gabi_Tulba coded with friends...

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

Bloody build stupid graph for a=1,b=1 and n>=1,damm i should have check more carefully for problem D :(.

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

Test number 31 on problem F is not correct. It has n = 1, while this is not possible. According to the statement m >= 1 and you can not have non-zero m for n = 1

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

test case 10 in C?

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

First contest during travelling ^_^

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

I was suffered from the word in problem A "commentary delegation burle demolish blahblah" I should study english more :(

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

How to solve E?

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

    Just precalculate for each street index the index just lower or equal where you can place the lamp-post. Then iterate over all possible values of powers and compute for all values the mincost by directly jumping to the place where you place next lamp-post and take minimum over all these. 39119701

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

    First check the maximum count of consecutive blocked positions, if this count (let this count's name be maxcon) is >=k or if the first position (0) is blocked then the answer is -1. Then search for the cheapest power starting from maxcon+1 to k. For power i, you will calculate its cost by putting its lamps greedily starting from j=0 and moving with j+=i, but if you reached some blocked j you should change j to the value of the last unblocked position before j (as if you were putting this lamp in the last unblocked position before j not in j itself).

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

can I get the rating in this round?

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

Does anyone know solution for G? My solution keeps getting TLE on test case 95, and I think mine has O(n log^2 n) time complexity and I can't think of any better solution. I used centroid decomposition

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

I was getting wrong answer in D coz I printed
YES
0 1 0 0 0
1 0 1 0 0
0 1 0 1 0
0 0 1 0 1
0 0 0 1 0
instead of
YES
01000
10100
01010
00101
00010

basically the same result with spaces. Shouldn't that be allowed to pass?

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

what I did in C was ignored all cases of brackets which gave )( this sort of thing, and kept a count of regular expression brackets, then if suppose (())), then this one has 1 closing bracket more, hence it will require any bracket sequence which has 1 opening bracket (such as (, (() or many like this)

I iterated for every sequence if it was a regular one, I added the total number of regular ones in the list given. If it was something like (())), which means it requires one open one, hence I added number of sequences with one open bracket, and when I came to the bracket with one open required, I ignored, hence I only calculated for the regular and closed ones, as open would be covered while doing for closed ones.

Can anyone suggest me what am missing?

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

I saw one of the test case of Problem D is 1 1 1, which means a graph with just one node.

The correct answer is "NO", can anyone explain why there is no answer when n = 1?

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

Remember to use long long everywhere, even though you think that it can't be over 2^31. Especially when you can't find your mistake anywhere.

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

What is the solution for D?

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

Can one hack this solution with making an anti-hash test? http://codeforces.me/contest/990/submission/39097287

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

awoo For the Problem B, I submitted this in C++ 11, it gave me a wrong answer. Then I submitted the same code in C++14 this and got accepted.

Because of wrong submission I had to face a penalty. I think this is wrong and it should be removed.

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

Are there any editorial now?

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

Why this 39120549 fails while this 39119719 passes for problem C?

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

How to solve F? i figured i would put in a super source and a super sink to reduce it to a max flow prob. But complexity for solving flow vector is too bad

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

when will the ratings be assigned regarding the educational round.

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

Awesome educational as usual, but I think two hours might have been a bit too little for seven problems. Most people didn't have the chance to work on F or G, which is a pity considering they were good problems.

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

I can't figure out why my solution hits the time limit. It should be O(nlog(n)). http://codeforces.me/contest/990/submission/39097135

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

    Brother i don't code in java but as i have seen several times in codeforces comments that arrays.sort() has a worst case complexity of O(n*n).

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

    Sorting Primitive types in Java uses quick sort so it takes O(N^2) in worst case. It's actually common for some reason to always include these anti quick sort tests in codeforces problems.

    To get around these you can do two things, declare your types as wrapper class (i.e Integer instead of int) so it becomes an object so runs in O(nlogn), or shuffle the input array.

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

How to solve E if a lamppost of power l were to cover [x - l, x + l] ??

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

The tragedy of every educational round.. waiting for the final test and the rating change.

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

How long do i have to wait to get my rating?

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

when will rating change ?

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

Well if you cannot wait to see the final result, you may submit your code in the archive and see how it works.

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

Can anybody explain me the strategy used to start solving Problem C or any similar question question's hint or link.

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

    One bracket sequence can be:

    1. Good.

    2. Need some left brackets ( to make it good.

    3. Need some right brackets ) to make it good.

    4. Can never be good.

    Then you can do bracket matching algorithm to determine which type one sequence is and how many left or right brackets that can make it good. You can see my code at http://codeforces.me/contest/990/submission/39098111

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

    A bracket sequence will be regular if, starting count from first character, for any position of that sequence, number of opening brackets "(" is more or equal to the number of closig bracket ")" ,and finaly number of opening bracket is equal to the number of closing bracket.

    Now , if you want to make a regular sequence by concatenating two sequences , there will be some options

    1.choose two regular sequence

    2.choose one sequence that have n more opening brackets(here n=total number of opening brackets-total number of closing bracket) .and for any position of that sequence number of opening brackets are not less than number of closing brackets.and choose another sequence that have n more closing brackets than opening brackets (here n is similar to previous one).and for any position of this sequence number of closing brackets should not be more than n+number of opening brackets. now you can concatenate these two sequences in one way , 1st+2nd will be a regular sequence .

    [Don't know how much I could explain , sorry for my bad English :) ]

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

why my rating hasn't change until now? How long does the change take after the contest finished?

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

Why couldn't system tests start automatically?

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

It’s really annoying to wait for rating changes after completing Hacking phase in every Educational round. please @MikeMirzayanov solve this.

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

after round 487 there will be no contest for 5-6 days and it's not good

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

Can anybody explain how to use generators for hacking ?

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

http://codeforces.me/contest/990/submission/39138201 can anyone help me finding whats wrong with my code for F?

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

Will the ratings beupdated after today's contest?

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

Auto comment: topic has been updated by awoo (previous revision, new revision, compare).

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

@ MikeMirzayanov regarding submission for the question b.microworld my submission is http://codeforces.me/contest/990/submission/39094917 it is getting correct answer(in local g++ compiler) for the test case which is showing as wrong output in the system run for one test case. this is looking very odd.

can you please look into this, and also wanted to know if any one facing same.

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

when will ratings get updated???

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

How is rating change determined here?? Pls help.

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

I want to become purple...

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

Auto comment: topic has been updated by awoo (previous revision, new revision, compare).

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

My following normal cin, cout solution for problem E timed out on test 6 as it was not able to read the input.

http://codeforces.me/contest/990/submission/39115276

whereas the following solution with ios sync passed.

http://codeforces.me/contest/990/submission/39145593

Is this justified?

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

Your crafting.oj.uz ratings are also updated!

We are seeking for a way to somehow differentiate the performance between the first and the 100th user, since currently both are the same because of the low $RATEDBOUND$s. If we just raise the bound, everybody's rating seems to be increased and this problem just occurs again.

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

Can anyone explain the logic behind the editorial of Problem C?