Автор PikMike, история, 7 месяцев назад, перевод, ,

Привет, 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 Далабаев, Роман Ajosteen Глазов, Иван 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 saw.ai 19
5 antguz 25:-17
Было сделано 549 успешных и 525 неудачных взломов.

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

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

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

•
• +213
•

 » 7 месяцев назад, # |   +1 Good luck to all!
 » 7 месяцев назад, # |   +10 Starts at unusual time :)
•  » » 7 месяцев назад, # ^ | ← Rev. 2 →   +39 I can finally participate in a contest without staying up late as a Chinese.
 » 7 месяцев назад, # |   +23 Welcome back BledDest!
 » 7 месяцев назад, # |   +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.
•  » » 7 месяцев назад, # ^ |   0 Just a beginner Contest bro !
•  » » 7 месяцев назад, # ^ |   0 There is a hacking phase too in this round so we will be very busy around 1205(UTC) lol
•  » » 7 месяцев назад, # ^ |   +14 Also if there something happens, they will have to increase contest time. Which is unfortunate from every angle.
 » 7 месяцев назад, # |   0 Sometimes only for unusual time many regular participants can not participate...!!!
 » 7 месяцев назад, # |   +13 Thank MikeMirzayanov for codeforces and polygon platform. :)
•  » » 7 месяцев назад, # ^ |   +8 Yep! We remember well what happened last time this statement was not included :) http://codeforces.com/blog/entry/59720?#comment-434084
 » 7 месяцев назад, # |   +15 Tester halyavin haven't registered yet)
•  » » 7 месяцев назад, # ^ |   +10 Don't worry step_by_step has :P. SpoilerLast Educational round step_by_step had most hacks 248.
 » 7 месяцев назад, # |   -46 Is it rated for Div. 3 then?
•  » » 7 месяцев назад, # ^ |   0 Div.3 is just a part of Div.2 so it is rated for Div.3.
•  » » 7 месяцев назад, # ^ | ← Rev. 2 →   +1
• »
»
7 месяцев назад, # ^ |
-34

Is it faked?

 » 7 месяцев назад, # |   +6 Finally, a contest after more than a week of non-practicing :D
 » 7 месяцев назад, # |   -26 very short statement hope problems too.
•  » » 7 месяцев назад, # ^ |   -36 upvote please
 » 7 месяцев назад, # |   0 Contests with hacking phase make me nervous before even participating.
 » 7 месяцев назад, # | ← 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
•  » » 7 месяцев назад, # ^ |   -6 the "education" in educational rounds stands for that.
•  » » 7 месяцев назад, # ^ |   0 If I think 4 times, contest would already be over :p
 » 7 месяцев назад, # |   0 Done with semesters finally!! Wishing higher ratings to everyone including myself :P
 » 7 месяцев назад, # |   0 For me, it is first time contest starts in reasonable time zone. (19:05 KST) I was struggle on midnight-beginning contest heretofore :)
 » 7 месяцев назад, # | ← Rev. 3 →   +10 float ship; // must be a float otherwise ship sinks
 » 7 месяцев назад, # |   +23 I couldn't help but notice that people with rating >= 2100 are not marked as out of competition.
•  » » 7 месяцев назад, # ^ | ← Rev. 2 →   -7 "Educational rounds are rated for users with rating below 2100, but it doesn't mean other users are unofficial. I think, In those rounds all users are welcome to participate officialy."
 » 7 месяцев назад, # | ← Rev. 2 →   +10 This time is friendly for Chinese!
•  » » 7 месяцев назад, # ^ |   +4 That's true. Also it is for all people living in the Far East)
•  » » 7 месяцев назад, # ^ | ← Rev. 2 →   0 I agree with you, but there is a spelling mistake.. Think of "int mian" "inlcude" "isotream" and so on.
•  » » » 7 месяцев назад, # ^ |   0 oops...I didn't notice that spelling mistake.
 » 7 месяцев назад, # |   0 Can someone explain what are the extended ACM ICPC rules? In what do they differ from the regular ACM ICPC?
•  » » 7 месяцев назад, # ^ |   +13 The differences are the hacking phase afterwards and full retest on the final set of tests with the hacks included.
•  » » » 7 месяцев назад, # ^ | ← Rev. 2 →   -20 hacking system is a bad system -_-
 » 7 месяцев назад, # |   0 I only solved 2 in the game.I am too weak.
 » 7 месяцев назад, # |   0 For problem D.. the only "NO" testcase is n > 1 and b > 1 .. is this true ?
•  » » 7 месяцев назад, # ^ | ← Rev. 4 →   +36 I think answer is NO for n = 2 and a=1, b=1, also n=3, a=1,b=1, and min(a,b)>1.
•  » » 7 месяцев назад, # ^ |   0 I think its NO when neither of them is 1 or if both of them are 1 (except when n=1) The rule here seems to be that either of G and H will be connected (either of a and b must be 1) ^Not sure if it's entirely true though
•  » » » 7 месяцев назад, # ^ |   0 Both of them can be connected at the same time also. (Consider the graph 1--2--3--4 with 4 vertices and 3 edges)
•  » » » » 7 месяцев назад, # ^ |   0 Oh yeah you're right
 » 7 месяцев назад, # |   0 I wonder what's the matter with problem D?
•  » » 7 месяцев назад, # ^ |   0 I forgot when the a==1 and b==1... how foolish I was!
 » 7 месяцев назад, # |   0 Give me some strong test case for problem C
•  » » 7 месяцев назад, # ^ |   0 1 )(
 » 7 месяцев назад, # |   0 What's the 3rd test case for problem D?
•  » » 7 месяцев назад, # ^ |   0 5 1 1
•  » » » 7 месяцев назад, # ^ |   0 The Answer for this is NO right?
•  » » » » 7 месяцев назад, # ^ |   0 Chain 1-2-3-4-5 satisfy this i think
•  » » » » 7 месяцев назад, # ^ |   0 Answer is yes. (1-2, 2-3, 3-4, 4-5)
 » 7 месяцев назад, # |   0 Can anyone tell me how many points will I get for successful hack and how many I will lose for an unsuccessful one?
•  » » 7 месяцев назад, # ^ |   +1 none. in educational rounds there is no points for hacking
•  » » » 7 месяцев назад, # ^ |   +2 Then I don't get what's the point of giving 12 hours for the hack, if there is no point for hacking, I mean at last they will check each code on their test code then why 12 hours for hacking. @Infinite_M can you please explain. I am actually a beginer here.
•  » » » » 7 месяцев назад, # ^ |   +10 There is a point. You can increase your rank if you hack solutions of people ranked above you ;)
•  » » » » 7 месяцев назад, # ^ |   0 All successful hacks will be added to system tests. existing test cases don't guarantee that program is correct.
•  » » » » » 7 месяцев назад, # ^ |   0 [user:killer_good] Can you please clarify this point? I was in an impression that codeforces provide some basic test cases to check code during contest.But they do have a test file including all corner test cases(like other websites , codechef,etc) after the contest they run every code through these test files(including corner test cases). is it true?? Or They just prepare base test cases on which they check submissions during contest and let participants find the corner test cases during hack??I mean don't they have test files for possible corner cases?
•  » » » » » » 7 месяцев назад, # ^ |   +1 for normal contests what you said is true. but for educational round system test will consist of successful hacks from users that's why we have a separate hacking phase unlike other contests.
 » 7 месяцев назад, # | ← 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...
•  » » 7 месяцев назад, # ^ |   +7 Тhe style of these codes is also different.
•  » » 7 месяцев назад, # ^ |   -7 Some coders such as tourist use this strategy sometimes.
•  » » » 7 месяцев назад, # ^ |   +35 tourist does not do this in codeforces. It only makes sense to do this in judges where the penalty is calculated by the time of the last submission, which is not the case of codeforces where the penalty is calculated as the sum of times of all accepted submissions. So here it is better to submit a problem as soon as you coded it, and not doing that is suspicious.
•  » » 7 месяцев назад, # ^ |   +7 Fortza_Gabi_Tulba is a joke account.... Gabi Tulba is purple on codeforces. Take the joke
 » 7 месяцев назад, # |   +1 Bloody build stupid graph for a=1,b=1 and n>=1,damm i should have check more carefully for problem D :(.
 » 7 месяцев назад, # |   +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
•  » » 7 месяцев назад, # ^ |   +7 Yes, sorry, there was a mistake in the statement. Luckily, no one got problems on that test during the contest.
 » 7 месяцев назад, # |   0 test case 10 in C?
•  » » 7 месяцев назад, # ^ |   0 Just open any solution which has reached to test case 10.
•  » » » 7 месяцев назад, # ^ |   0 It is almost impossible to understand from someone's solution what I am failing at as my logic can be different than to the referred code.
•  » » » » 7 месяцев назад, # ^ | ← Rev. 2 →   0 When you open a solution you can see test cases it has reached: in this case75000 (()) )(( ())) ))() )((( ((( ))( ())) )() )))( ()(( ))) ((( )((( )((( )() ()(( )((( )() ((() ((( ))( (()) ))(( (()( )() ()) )(( (((( ))() ))) (() ()( ((( )((( (()( )((( ()( ((( ())) )(( ))() ((( ()) ())( ))(( ()( )((( (((( ()() ())( ))) (((( ()) )()( (()) )(() ()() ))) ))( ))( ()) (() ))(( ()(( )((( ()) )()) )(() ()() ()( )))( )(( ()) (() ))(( ()) (()( ((() ((() ))( ()( ))(( )(() ()( (() )(( ((() )()) (()( )(() ...Perhaps that will help.
•  » » » » 7 месяцев назад, # ^ |   +3 If you open a solution, you can view all of the test cases that solution has reached. Just scroll down. That's what Emil_PhysMath meant.
•  » » » » » 7 месяцев назад, # ^ |   0 thanks, I did not know that!
•  » » » » » » 7 месяцев назад, # ^ |   0 Do note that it only works out of contest :)
•  » » 7 месяцев назад, # ^ |   +1 You must not include cases such as )( or )((() in your answer
•  » » » 7 месяцев назад, # ^ |   0 yes i have done that.
•  » » » » 7 месяцев назад, # ^ |   0 5 ))(( ()() (((( )))) ()())))) ans is 3. Your code says 5
 » 7 месяцев назад, # |   +7 First contest during travelling ^_^
 » 7 месяцев назад, # |   +6 I was suffered from the word in problem A "commentary delegation burle demolish blahblah" I should study english more :(
 » 7 месяцев назад, # |   +12 How to solve E?
•  » » 7 месяцев назад, # ^ | ← 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
•  » » » 7 месяцев назад, # ^ |   0 Why O(nlogn)? I can prove only O(nsqrt(n)).
•  » » » » 7 месяцев назад, # ^ | ← Rev. 4 →   +30 Proving that for power i it needs O(n/i) should be enough. Let us say that we are computing for power i and length n. Now, say there is a lamppost at position l and the next lamppost be placed at r now even next lamppost must be placed at least l+i, clearly except in the case that it is not possible to illuminate the street. So there should be atmost about ~(2*n)/i iterations.So, the complexity should be O(k+nlogn). Please correct me if something is wrong.
•  » » 7 месяцев назад, # ^ | ← 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).
•  » » » 7 месяцев назад, # ^ |   0 For the 1st test case,6 2 31 31 2 3Can't we use the lamp with power 1 to light the whole street? If we put it at position 0 , it will cover [0,1] . then at 2 covering [2,3] , then at 4 covering [4,5] and at 5 covering [5,6]That way the total cost will be 4, which is cheaper.
•  » » » » 7 месяцев назад, # ^ | ← Rev. 2 →   +1 You need also to cover the segments [1, 2] and [3, 4]. There was an announcement regarding this during the contest which was:"You have to illuminate the whole segment, not only its integer coordinates. For example, if n = 3, illuminating [0, 1] and [2, 3] is not enough."
•  » » » » » 7 месяцев назад, # ^ |   +5 Oh! Didn't notice. Thanks
 » 7 месяцев назад, # |   0 can I get the rating in this round?
 » 7 месяцев назад, # | ← 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
•  » » 7 месяцев назад, # ^ |   0 This should work, because there are only log(ai) different values of gcd, so complexity will be n*log(ai)^2.
•  » » » 7 месяцев назад, # ^ |   0 Thank you. I was thinking too complicated solution, you are very smart
•  » » » 7 месяцев назад, # ^ |   +2 can you please explain the idea a little bit.
•  » » » 7 месяцев назад, # ^ | ← Rev. 2 →   0 Intuitively I felt that there should only be around log(ai) different values of gcd, but I can't think of a good formal argument for why that is true. Do you have any good proof for it?
•  » » » 7 месяцев назад, # ^ | ← Rev. 2 →   +8 Hacked huh. There are actually O(divisors) gcd values for paths (think about a leaf for every divisor and the rest of the tree has the same value). What you were thinking about is another thing, there are at most O(log) CHANGES of gcd in a path.So your solution is actually O(N * maxDivisors(2e5)^2) along with bad constant from using map (mostly chache misses I guess).
•  » » » » 7 месяцев назад, # ^ |   +3 It works, just forgot to clear maps after using ;w;
•  » » » » » 7 месяцев назад, # ^ | ← Rev. 5 →   +16 http://codeforces.com/contest/990/submission/39135974 I submited the exact same solution that got hacked and it passed in the same time as before the hack hmmm.... Looks like that hack didn't get into systests lolEdit: we can see the hack now http://codeforces.com/contest/990/hacks/458169/test. I tried to test it locally and the second code crashed in my computer (probably couldn't handle the memory lol). Maybe someone could add this test to the test set? This is a intuitive solution that has already appeared in codeforces but with downward paths only iirc, I wouldn't be surprised if a similar solution passed systests just because it didn't got hacked.Edit2: I tested it in a custom invocation and the second submission passes in a bit under 4 seconds (ignoring input) and without the clear it's MLE. Can someone prove a lower bound than what I said for this solution?Edit3: the hacker that did this did most hacks for G http://codeforces.com/contest/990/hacks?chosenProblemIndex=G and the test didn't get added. Hopefully he didn't miss anyone :PEdit4: this case was added!
•  » » » » 7 месяцев назад, # ^ |   +1 Hey, can you explain your approach?
•  » » » » » 7 месяцев назад, # ^ |   +6 For each i, compute h(i) = number of paths that have value multiple of i. For each i, dp[i] = number of paths that have value exactly i = h(i) — dp[i * 2] — dp[i * 3] — dp[i * 4] — dp[i * 5] — ...
 » 7 месяцев назад, # | ← 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?
•  » » 7 месяцев назад, # ^ |   +5 Only trailing spaces are ignored(I think)
 » 7 месяцев назад, # | ← 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?
•  » » 7 месяцев назад, # ^ |   0 I don't understand your solutionwhat I did in C was ignored all cases of brackets which gave )( this sort of thing Do you ignore "()( )( "? Then your program won't count ()( )( + )( )() as a regular bracket sequence.
•  » » » 7 месяцев назад, # ^ |   0 Nah, I ignored the ones which has )( both
•  » » 7 месяцев назад, # ^ |   +5 At last I found it. Your program gives wrong answer to this test case. I hope it will help:) input2)()()(()())( right answer1 your programs output0
•  » » » 7 месяцев назад, # ^ |   +1 thank you. I was also stuck on the same test case.
•  » » » » 7 месяцев назад, # ^ |   +1 You're welcome:) I hope it will help you to correct your code.
 » 7 месяцев назад, # |   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?
•  » » 7 месяцев назад, # ^ |   +4 Answer is YES http://codeforces.com/contest/990/submission/39099219 #6
•  » » 7 месяцев назад, # ^ |   +5 forgive me, I misunderstand it.
•  » » » 7 месяцев назад, # ^ |   +4 It's okay XD
 » 7 месяцев назад, # |   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.
•  » » 7 месяцев назад, # ^ |   +1 That is my strategy!!!
•  » » 7 месяцев назад, # ^ |   0 Once this slowed my solution down to make it get TLE though so it's not a strictly good idea
•  » » » 7 месяцев назад, # ^ |   0 Yeah you are right. But once on a USACO contest I got WA. Then I changed only one variable(I thought only it could cause a WA) to long long and again got WA. After the contest I read the editorial and the solution was suspiciously similar to mine. I changed all variables and got AC:(After that changing int to long long is the first(or maybe the second) thing I do after getting WA.
 » 7 месяцев назад, # |   0 What is the solution for D?
•  » » 7 месяцев назад, # ^ | ← Rev. 2 →   +1 Connecting vertex to all others means that this vertex will make isolated component in graph's complement. So if b > 1, you need b - 1 vertex connected with other vertexes in main graph. If a > 1, you need complete graph on n - a + 1 vertexes, and a - 1 isolated ones.
•  » » » 7 месяцев назад, # ^ |   +6 For the second case I think you meant complete graph on n-a+1 and a-1 isolated ones.
•  » » » » 7 месяцев назад, # ^ |   +8 Yeah, sure, thx :)
 » 7 месяцев назад, # |   +8 Can one hack this solution with making an anti-hash test? http://codeforces.com/contest/990/submission/39097287
•  » » 7 месяцев назад, # ^ |   +2 Yes.
•  » » » 7 месяцев назад, # ^ |   +2 I'm sure halyavin can do it.
•  » » 7 месяцев назад, # ^ |   0 Probably not because the constraint on the input is a[i] <= 1e6 so there aren't many numbers to create collisions.
•  » » 7 месяцев назад, # ^ |   -13 Unordered map doesn't use a fixed hash fucntion so it's "improbable" to find a hack.
•  » » » 7 месяцев назад, # ^ | ← Rev. 2 →   0 I once got several WAs in a problem because of a test designed to break unordered_map hash. Isn't it the same for hacks? Or does testing behaves differently using a fixed seed?
 » 7 месяцев назад, # |   -24 PikMike 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.
•  » » 7 месяцев назад, # ^ | ← Rev. 2 →   0 The code has an uninitialized variable. In test 3, there's nothing assigned to the variable 'got' in the binary search code. You can initialize it with a specific value and see what happens.
•  » » 7 месяцев назад, # ^ |   +5 you're right since your code has a mistake 2nd submission should be ignored.
•  » » » 7 месяцев назад, # ^ |   +4 I don't think any action would be taken by MikeMirzayanov and CF admins. I hope they take decision in my favour, if they do something. Well I enjoyed the contest, though I didn't perform well. I think next round would be favorable.
 » 7 месяцев назад, # |   0 Are there any editorial now?
•  » » 7 месяцев назад, # ^ |   +1 after the hacks
 » 7 месяцев назад, # | ← Rev. 2 →   +6 Why this 39120549 fails while this 39119719 passes for problem C?
•  » » 7 месяцев назад, # ^ |   0 I don't think op[N]={} initializes an array with zeroes, but I think op[N]={0} do.
•  » » » 7 месяцев назад, # ^ | ← Rev. 2 →   0 Even that failed. 39127177 . I am unable to understand the Diagnostics. Can someone check the Diagonostics of the above solution and explain to me. Thanks.
•  » » » 7 месяцев назад, # ^ |   +16 it actually does. Not an undefined behaviour.
•  » » 7 месяцев назад, # ^ | ← Rev. 2 →   +20 You are writing in an empty string (st) without changing its size, so it's undefined behavior. When stuff like this happens it's usually because you allocated the memory badly.
 » 7 месяцев назад, # |   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
•  » » 7 месяцев назад, # ^ | ← Rev. 2 →   +24 Notice that if we add a cyclic flow on a valid flow, it's still valid. So, if the graph has cycles, we can use cyclic flow to zero an edge on the cycle, effectively removing it. Repeatedly remove edges from cycles until the graph becomes a tree, and then the problem is pretty simple.(recursively solve it from leaves) Complexity is O(n).I didn't solve F at contest but shortly after the contest I figured this out. Hope that I am correct.Update: confirmed it works
•  » » » 7 месяцев назад, # ^ |   0 Beautiful solution, thanks! I just submitted using your idea and can confirm that this indeed works
•  » » » » 7 месяцев назад, # ^ | ← Rev. 3 →   0 why if sum !=0 test incorrect? This test looks correct.
•  » » » » » 7 месяцев назад, # ^ |   +3 Look at the bottom right node, it has a netflow of 9, and not -9. As for why the sum should be zero, you are flowing from one node to the other, so the net inflow must be equal to the net outflow
•  » » » » » » 7 месяцев назад, # ^ |   0 oh, my mistake, ty
 » 7 месяцев назад, # |   0 Why My solution for D is wrong??http://codeforces.com/contest/990/submission/39122954
•  » » 7 месяцев назад, # ^ |   +3 If you scroll down, you can literally see the test together with the message "wrong answer The number of components in the complement graph should be 84, but found 1"
•  » » » 7 месяцев назад, # ^ |   0 Ahh finally got My mistake but still can't visualize if a=b=1 and n<4 answer is No except n=1
 » 7 месяцев назад, # |   0 when will the ratings be assigned regarding the educational round.
•  » » 7 месяцев назад, # ^ |   0 after hacks
•  » » » 7 месяцев назад, # ^ |   0 was this round rated for Div 3?
•  » » » » 7 месяцев назад, # ^ |   0 for everyone below rating 2100 as mentioned
•  » » » » » 7 месяцев назад, # ^ |   0 Okay thanks
 » 7 месяцев назад, # |   +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.
•  » » 7 месяцев назад, # ^ |   +3 Yes i worked out problem E as i found it was greedy and almost wrote the code but just needed 5 mins to do some case testing.
 » 7 месяцев назад, # |   0 I can't figure out why my solution hits the time limit. It should be O(nlog(n)). http://codeforces.com/contest/990/submission/39097135
•  » » 7 месяцев назад, # ^ |   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).
•  » » 7 месяцев назад, # ^ | ← 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.
•  » » » 7 месяцев назад, # ^ |   0 Thank you, I will try that tomorrow, I have never had that kind of problem before.
 » 7 месяцев назад, # |   0 How to solve E if a lamppost of power l were to cover [x - l, x + l] ??
•  » » 7 месяцев назад, # ^ |   +8 So it turn out we can shift the lamppost to its left end in this segment to cover [x, x + 2 * l] only if [x + l] was not blocked and the problem just reduces to the same version in here.This idea was suggested by lrvideckis :)
•  » » 7 месяцев назад, # ^ | ← Rev. 2 →   0 Fck myself. I was trying to solve this problem during contest. And couldn't create solution. So I decided to solve G instead.Only after your comment I reread the stamenent. (((
•  » » » 7 месяцев назад, # ^ |   0 trust me you're not alone :'( I had the same misconception about this problem :|
 » 7 месяцев назад, # |   +20 The tragedy of every educational round.. waiting for the final test and the rating change.
 » 7 месяцев назад, # |   +3 How long do i have to wait to get my rating?
•  » » 7 месяцев назад, # ^ |   0 Until the admins of the contest wake up! We need to wait for final tests.
•  » » » 7 месяцев назад, # ^ |   0 hahahahhaha didn't really expect an answer from you.It seems like you've been checking out my profile.
•  » » 7 месяцев назад, # ^ |   0 Well it's 10:10pm here so I will simply go sleep soon and check the next morning instead of worrying about it now. :P Good night!
 » 7 месяцев назад, # |   +5 when will rating change ?
 » 7 месяцев назад, # |   0 Well if you cannot wait to see the final result, you may submit your code in the archive and see how it works.
 » 7 месяцев назад, # |   0 Can anybody explain me the strategy used to start solving Problem C or any similar question question's hint or link.
•  » » 7 месяцев назад, # ^ | ← Rev. 2 →   0 One bracket sequence can be: Good. Need some left brackets ( to make it good. Need some right brackets ) to make it good. 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.com/contest/990/submission/39098111
•  » » » 7 месяцев назад, # ^ |   0 thanks now i got the algo to proceed
•  » » 7 месяцев назад, # ^ |   +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 options1.choose two regular sequence2.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 :) ]
•  » » » 7 месяцев назад, # ^ |   0 thanks it really helped a lot
 » 7 месяцев назад, # |   +13 why my rating hasn't change until now? How long does the change take after the contest finished?
•  » » 7 месяцев назад, # ^ |   0 We have to wait for the problem maker to wake up.
 » 7 месяцев назад, # |   +64 Why couldn't system tests start automatically?
 » 7 месяцев назад, # | ← Rev. 2 →   +5 It’s really annoying to wait for rating changes after completing Hacking phase in every Educational round. please @MikeMirzayanov solve this.
•  » » 7 месяцев назад, # ^ |   +5 Do you know that there is a chrome extension for codeforces? You can check the expected rate change quite precisely.
•  » » » 7 месяцев назад, # ^ |   +3 The issue, system tests have not happened yet so expected rating change is not final.
 » 7 месяцев назад, # |   0 after round 487 there will be no contest for 5-6 days and it's not good
 » 7 месяцев назад, # |   0 Can anybody explain how to use generators for hacking ?
•  » » 7 месяцев назад, # ^ |   +3 It requires a code that prints out the test case to stdout. i.e. Use printf / cout to make a test case.
 » 7 месяцев назад, # |   0 http://codeforces.com/contest/990/submission/39138201 can anyone help me finding whats wrong with my code for F?
 » 7 месяцев назад, # |   +1 Will the ratings beupdated after today's contest?
 » 7 месяцев назад, # |   0 Auto comment: topic has been updated by PikMike (previous revision, new revision, compare).
 » 7 месяцев назад, # |   0 @ MikeMirzayanov regarding submission for the question b.microworld my submission is http://codeforces.com/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.
•  » » 7 месяцев назад, # ^ | ← Rev. 2 →   0 adedalic Ajosteen BledDest can anyone respond to this.
•  » » 7 месяцев назад, # ^ |   0 ar.size() - 2 can underflow (unsigned), which results in a large value and you access the array at that value, i.e. undefined behavior
•  » » » 7 месяцев назад, # ^ |   0 i think that case wont be arrising. please check by running , i checked it.test case: 1 1 1 output: 1
•  » » » » 7 месяцев назад, # ^ |   0 @yassin_ reply please??
•  » » » » » 7 месяцев назад, # ^ |   +12 It's undefined behavior, results can vary for different runs or compiler versions
•  » » » » 7 месяцев назад, # ^ | ← Rev. 2 →   +12 Test 15 as you can see is: 1 1 1 and your solution gives: -1199 what is definitely UB. It seems like it is caused by ar.size() - 2.
•  » » » » » 7 месяцев назад, # ^ | ← Rev. 2 →   -20 @adedalic I checked it using local compiler and some other online as well which are working well for that input. can you once check it once by running the code. since i dont feel some thing undefined should be occuring for this code.
•  » » » » » » 7 месяцев назад, # ^ |   0 who are down voting this,..please explain me whats wrong in the code.(which is working fine in other compilers )
•  » » » » » 7 месяцев назад, # ^ | ← Rev. 2 →   0 so you guys are saying problem arise at ~~~~**~** while(n1>=0&&ar[n2]-ar[n1]<=k&&ar[n1]!=ar[n2]) ~~~~~ line 30 of code where compiler runs differently for this line. is it??
 » 7 месяцев назад, # |   0 when will ratings get updated???
•  » » 7 месяцев назад, # ^ |   0 ratings updated. Just saw it
 » 7 месяцев назад, # |   0 How is rating change determined here?? Pls help.
•  » » 7 месяцев назад, # ^ |   +1
 » 7 месяцев назад, # |   0 I want to become purple...
 » 7 месяцев назад, # |   +1 Auto comment: topic has been updated by PikMike (previous revision, new revision, compare).
 » 7 месяцев назад, # |   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.com/contest/990/submission/39115276whereas the following solution with ios sync passed. http://codeforces.com/contest/990/submission/39145593 Is this justified?
 » 7 месяцев назад, # |   +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.
•  » » 7 месяцев назад, # ^ |   0 What is this website, can anyone explain. Does it use codeforces API?
•  » » » 7 месяцев назад, # ^ |   0 You can refer to this blog post.
 » 7 месяцев назад, # |   0 Can anyone explain the logic behind the editorial of Problem C?