### KAN's blog

By KAN, 4 years ago,

Hi!

The Codeforces Round #398 (Div. 2) is going to be held on Saturday, 18 February 2017 at 9:05 UTC for participants from division 2.

The round is based on XIII Nizhny Novgorod Olympiad in Informatics for high school students named after V. D. Lelyukh, which will take place on Saturday in Nizhny Novgorod. However, not all problems from the Olympiad are included into this round.

The problems were prepared by KAP, I_Remember_Olya_ashmelev, ZhNV, kuzmichev_dima, mmatrosov, mike_live, arsor and me.

You will be given two hours to solve five problems. As usual, participants from division 1 can take part out of competition.

Scoring: 500-1250-1500-2000-2500.

UPD: The contest is over, thanks to all who has participated! Congratulations to the winners:

Div. 2:

Div. 1:

I apologise for the problem difficulty of the problem B, we expected much more accepteds. Hope you liked the problems! The editorial will be posted in 1.5 hours after the Olympiad is finished. Editorial.

We know about the issue with ratings, they will be rolled back and then updated properly. Don't worry.

• +135

 » 4 years ago, # |   +730
•  » » 4 years ago, # ^ |   -8 megmi
•  » » 4 years ago, # ^ |   +10 This comment has more likes than the blog.
 » 4 years ago, # |   +156 Do not thank MikeMirzayanov? DANGEROUS!!!
•  » » 4 years ago, # ^ |   0 WAT THE 5 TEST (A) SANAVA GLITCH
 » 4 years ago, # |   -42 ** ** *****?
•  » » 4 years ago, # ^ |   -35 ***, ** ** *****!
•  » » » 4 years ago, # ^ |   -52 ***, ** ** *****!
•  » » 4 years ago, # ^ |   -22 **** this meme
•  » » » 4 years ago, # ^ |   -49 Comment here to get Free downvotes !! :D
 » 4 years ago, # |   -35 Wait, correct me if I'm wrong (not likely haha) but if someone has a friend who participated in the XIII Nizhny Novgorod Olympiad then he could technically get some advice from him regarding the problems... Are there any countermeasure for that or should we all try befriend some novgorodians?
•  » » 4 years ago, # ^ |   0 "The round is based on XIII Nizhny Novgorod Olympiad in Informatics for high school students named after V. D. Lelyukh, which will take place on Saturday in Nizhny Novgorod."I assume these rounds will run almost simultaneously.
 » 4 years ago, # |   +73 That feeling when you open "Contests" tab and there's this
•  » » 4 years ago, # ^ |   +16 No wonder the queue is so long......
•  » » » 4 years ago, # ^ |   -33 why you are everywhere ? Codeforces Round #398 (Div. 2) Codeforces Round #397 (Div. 2) Codeforces Round #396 (Div. 2) . . .
•  » » » 4 years ago, # ^ |   -15 This Week Codeforces achieve 4th Century.......
•  » » 4 years ago, # ^ |   0 It is so much exciting. isn't it... :)
 » 4 years ago, # |   -23 SOORY,BUT THIS CONTEST MAY BE UNRATED BECAUSE CF SEEMS NOT SO WELL
•  » » 4 years ago, # ^ |   0 be cool
•  » » 4 years ago, # ^ |   0 ^wtf
•  » » 4 years ago, # ^ |   +28 U seem not so well
•  » » » 4 years ago, # ^ | ← Rev. 2 →   -19 c
 » 4 years ago, # |   +12 That moment when it's holiday but you have to wake up early to participate the contest :(
 » 4 years ago, # |   0 Wish the problems to be very Interesting! ^_^
 » 4 years ago, # |   -12 5 problems but 10000 ideas
 » 4 years ago, # |   -16 i hope every one have good contest and i hope the problems be interesting and have many ideas.
•  » » 4 years ago, # ^ | ← Rev. 2 →   -10 c
•  » » » 4 years ago, # ^ | ← Rev. 3 →   0 GOH KHORDAM
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   0 ...
•  » » » » » 4 years ago, # ^ |   0 haji mikonameta
 » 4 years ago, # |   -31 Well, i would like to suggest that stat using March 2017 Calendar to manage all the work related activities.
 » 4 years ago, # |   +4 I cannot register to the round, could somebody explain why ? thanks
 » 4 years ago, # |   +23 The most creative(in aspect of the difficulty) contest ever, and in my humble opinion, no other contests will beat this dishonorable record :D
 » 4 years ago, # |   +1 Love the change in friends standings page! :)
•  » » 4 years ago, # ^ |   0 What is it?
•  » » » 4 years ago, # ^ |   0 Now you can see your actual rank amongst your friends.
 » 4 years ago, # |   +9 Nice and tiny questions You can solve them with push and shove
 » 4 years ago, # |   +3 What sort of contest is this. I couldn't do any. #Senseless
 » 4 years ago, # | ← Rev. 3 →   +44 Why I can see the questions of other participants?
•  » » 4 years ago, # ^ |   +29 The most ridiculous question is "give me 5 test case" :D And he got answer
•  » » 4 years ago, # ^ |   +1 At least I finally understand how frequent the admins received messages during a single contest. And I know why they sometimes respond slow. (I hope the high frequency of messages in this contest is not related to the unclear English statments)
 » 4 years ago, # |   -18 One of the best problem sets in a while. Keep it up guys!
•  » » 4 years ago, # ^ |   +4 yeah, definitely, hard though interesting
•  » » 4 years ago, # ^ | ← Rev. 2 →   +12 For you...
 » 4 years ago, # |   +24 I do think the legends of the problems are toooooooooooo long to read. Maybe shorter legends and clearer problems instead?
 » 4 years ago, # |   +151 Hardest Div2 B I've ever seen
•  » » 4 years ago, # ^ |   0 difficult
•  » » 4 years ago, # ^ |   0 true that.
 » 4 years ago, # |   +63 scoring distribution should be 750-2000-2000-2000-2500
•  » » 4 years ago, # ^ | ← Rev. 2 →   +6 nonono it should be 750-3000-1000-1000-2500
•  » » » 4 years ago, # ^ |   +1 1000 for C and D? It is not Div1 contest!
•  » » » » 4 years ago, # ^ |   +13 Just mean to emphasize the interesting problem B...
 » 4 years ago, # |   +21 Rating prediction for this contest could be found here or there.Extensions: As you could see unfortunately, it is bit difficult for my service to handle such amount of request. I'm sorry for that again, hope mirror solve this problem.
•  » » 4 years ago, # ^ |   +8 RIP RATINGS
•  » » 4 years ago, # ^ |   0 The link isn't working. The page opens and shows some error HTTP Status 500 — An exception occurred processing JSP page /roundResults.jsp at line 15type Exception reportmessage An exception occurred processing JSP page /roundResults.jsp at line 15description The server encountered an internal error that prevented it from fulfilling this request.exception
•  » » » 4 years ago, # ^ |   0 Second one is working.
•  » » » » 4 years ago, # ^ |   0 My name isn't there :/
•  » » » » » 4 years ago, # ^ |   0 Found it +33
•  » » » » » 4 years ago, # ^ |   0 902 vatsalsharma376 33 1587 1453 1486 
•  » » » » 4 years ago, # ^ |   0 not any more :D
•  » » » » » 4 years ago, # ^ |   0 For now both links contains my final prediction:)
•  » » » 4 years ago, # ^ |   0 Use second link
•  » » 4 years ago, # ^ | ← Rev. 2 →   +6 This time the results were lot different. This shows -22 negative rating change whereas i almost got exact positive rating change.Edit: It seems something is wrong with cf rating changes...
•  » » » 4 years ago, # ^ |   0 I hope my service doesn't broke codeforces:) Actually now on your rating graph your place in the contest is 203, but in standings it is 319.
 » 4 years ago, # | ← Rev. 2 →   +161 how to solve B
•  » » 4 years ago, # ^ |   +17 Even reds couldn't solve B :(
•  » » 4 years ago, # ^ | ← Rev. 6 →   0 At first, you must find such time between ts and tf, when there won't be anyone. The waiting time at this case 0. If there are always someone, then u have to find time among all pre-visiters, which is the smallest ( a waiting time, not arrival time).
•  » » 4 years ago, # ^ |   0 that's a popular "WTF so standard easy-peasy problem" among russians :D
•  » » 4 years ago, # ^ |   0 Lets try to stand in front of every person p in the queue — optimally, we need to come 1 minute earlier than p. Find the minimum of that waiting times (and don't forget to check will it be enough time to become documents)Before printing the answer check what if we will come after all persons — will it be enough time (t) to become documentsComplexity O(n)Sry for bad english)
 » 4 years ago, # |   +6 Someone Please tell Me What the hell was pretest 4 of div2B ?? Any ideas anyone. Wasted the entire contest reading the question and finding bugs on the same.
•  » » 4 years ago, # ^ |   0 Initially I assumed that the starting time can be any time < e. But I got 5 WAs on pretest 4, lol. When I changed it to start_time < e-t, then I passed that case.
•  » » » 4 years ago, # ^ |   -8 The problem statement clearly states "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)." Your answer indicates that the receptionist ALSO STOPS SERVING THE ONE HE IS SERVING. Did I get that right?
•  » » » » 4 years ago, # ^ |   0 Yes, I got confused by that line as well. :(
•  » » » » » 4 years ago, # ^ |   0 Exactly if start_time
•  » » » » » » 4 years ago, # ^ |   0 There is probably no such input because "It is also guaranteed that Vasya can arrive at the passport office at such a point of time that he would be served by the receptionist."
•  » » » » 4 years ago, # ^ |   -8 Yes it has to be "ALSO STOPS SERVING THE ONE HE IS SERVING.". I also had the same doubt and clarified it early (luckily). I believe problem statements weren't clear on this.
•  » » » » » 4 years ago, # ^ |   0 The problem statement is extremely clear on this. In fact, it clarifies that the statement "stops serving visitors" does not relate to currently served visitor. Model solution and tests are simply broken.
•  » » » » » » 4 years ago, # ^ |   +5 No I was wrong, the key part of the statement that I read incorrectly was "If the receptionist would stop working within t minutes". So the statement is concerned with time (end — t), like satyaki3794 said. After that time point the receptionist does not accept new customers, but he will serve the current customer through, and be done with him before end time.
•  » » » » 4 years ago, # ^ |   +5 No, obviously not
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 You can finish exactly in tf. Example: ts = 3, tf = 7, t = 4. It is possible.
 » 4 years ago, # | ← Rev. 2 →   0 How to solve A
•  » » 4 years ago, # ^ |   0
 » 4 years ago, # | ← Rev. 2 →   -19 What the Fuck ? It is impossible to solve the 3rd problem in Java if u use adjacency lists.Why >>>? I get MLE for storing the edges. Is this even fair ?
•  » » 4 years ago, # ^ |   0 I have solved using Adj list in java only.
•  » » » 4 years ago, # ^ |   0 MLE Code , Linear in Time and Memory :http://codeforces.com/contest/767/submission/24771836
•  » » » 4 years ago, # ^ |   0 No you didn't :| Isn't this you — 24759322? RTE in test 32 :|
•  » » » 4 years ago, # ^ |   -8 Stack overflow ho gaya naa bhai ? Kuch bologe abhi ? Khud pe jab guzarti hai naa, tab pata chalta hai
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   0 http://codeforces.com/contest/767/submission/24775881forgot to increase the stack size that's why.
•  » » » » » 4 years ago, # ^ |   0 http://codeforces.com/contest/767/submission/24775207My submission, 150 % same, code just a different language (C++)Manually stack size increase kare bina.
•  » » 4 years ago, # ^ |   0 I don't know java much but isn't this adjacency list?
 » 4 years ago, # |   0 Was B binary search? I was trying to binary search between the times of the people in the queue and took the best one out of all the gaps but I couldn't get it to work.
•  » » 4 years ago, # ^ |   +2 First check if there's a time before tf such that no one is waiting for processing. Then vasya can come at this time, and wait for 0 second.If not, and if there are k different arrival times in input, then try to see if there's a minimum waiting time possible for the preceding time for all these k values. Additionally, check the time after all values in input are processed, if then vasya can still get his request processed, before tf.
•  » » » 4 years ago, # ^ |   0 Thanks! That makes a lot of sense actually.
•  » » » 4 years ago, # ^ |   0
•  » » » » 4 years ago, # ^ |   +1 Can't access your code. You can check my submission. I wrote comments for everything.
•  » » » » » 4 years ago, # ^ |   0 Can you link your submission?
•  » » » » » » 4 years ago, # ^ |   0 codell n,m,a[N],b,c,d,k,h,w,x,y,p,q,t,ans,res,ma,mi,T,act=0,pas=1,cur,flag,now;ll ts,tf;vector< node > vec;typedef map Mapp;Mapp cnt,start; void input(){ ios_base::sync_with_stdio(false);cin.tie(NULL); cin >> ts >> tf >> t; tf--; cin >> n; forr(i,1,n+1) cin >> a[i];} void solve() { //vector< pii > v; cur = ts; forr(i,1,n+1) { if( a[i] <= cur ) // a[i] has to be processed { cur += t; } else // vasya can come at this time { cout << cur; return; } if( cur > tf - t + 1 ) // no vacant slot { break; } } if( cur <= tf - t + 1 ) // all processed, can come now { cout << cur; return; } forr(i,1,n+1) cnt[ a[i] ]++; // how many people come at each time cur = ts; // serving time for(auto u : cnt) { start[ u.ff ] = cur; cur += u.ss * t; //finish[ u.ff ] = cur - 1; if( cur > tf - t + 1 ) break; } // check coming before each group mi = 2e18; // waiting time ans = 0; // vasya's arrival time for(auto u : start) { vec.pb( node( u.ff, start[ u.ff ] ) ); //, finish[ u.ff ] ) ); } forr(i,0,vec.size()) { ll arrive = vec[i].arrive - 1; ll start = vec[i].start; if( mi > start - arrive ) { mi = start - arrive; ans = arrive; } } cout << ans; } int main() { input(); solve(); return 0; }
•  » » 4 years ago, # ^ |   0 Just check Ai, Ai - 1, ts, and after all people. (Ai is arrival time of i)
 » 4 years ago, # |   +2 lucky I skipped the 2nd one for last
 » 4 years ago, # |   0 Please, someone explain E to me. I think I reduced it to knapsack but with big dimensions.
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 You don't need to do knapsack. You always choose one of these per day: paying with notes only OR paying exactly. And "paying with notes only" can be thought that you get 100 coins and some dissatisfaction. So greedy will work. Simulate from beginning. Whenever you don't have enough coins, choose a day with minimum dissatisfaction from the past and add it to the answer. Priority queue will be enough to implement this.
•  » » » 4 years ago, # ^ |   0 Ooooh, we get the change back, I just ignored it :D Thank you!
 » 4 years ago, # | ← Rev. 2 →   0 I guess time limit for D is too strict, my Nlog(10^7) + Mlog(10^7) didn't pass. Plz have a look and tell me if I am missing something: http://ideone.com/Tdob4l
•  » » 4 years ago, # ^ |   +12 I think their intended solution is with time complexity O(n + m + 107). And I passed pretest with this time complexity.
•  » » » 4 years ago, # ^ | ← Rev. 2 →   0 But shouldn't my solution pass too as it is well within 10^8 compuations?
•  » » » » 4 years ago, # ^ |   0 I think using set is with big constant on each operation like insert and upper_bound, which leads your solution TLE.
•  » » » » » 4 years ago, # ^ |   0 I guess all operations of set takes log( set.size() ) time which I computed earlier, and then too I don't find a way where computation increase to 10^8. Can you plz tell when we should avoid set( as u say it causes TLE ) and use some other option as I usually see 10^8 compution( if exceeding then TLE )?
•  » » » » » » 4 years ago, # ^ |   +5 Ummm... Just to understand using functions from STL may requires higher time as they are usually with larger constanst. For instance, writing binary search on your own is usually faster than using lower_bound from STL. Also, maintaining stacks or queues on your own are usually faster than using queue<> and stack<> from STL as well.You may try to have some experiments on performing million times of binary search written by yourself, and with the same case, test on performing million lower_bound.In cases that we can easily write functions on our own, and the problem TL is very tight, we should not rely on STL functions.
•  » » » » » » » 4 years ago, # ^ |   0 Thanks a lot!!
•  » » » » » 4 years ago, # ^ |   0 Can you tell me how to pass memory limit? I used up to 262000 kb and cannot pass the test zz
•  » » » » 4 years ago, # ^ |   +3 It is not well within 10^8 operations. If any of the cartons has size 10^7 then variable maa is also equal to 10^7.Before you begin calculating the answer you insert all integers from 0 up to maa into your set and this initialization itself takes around 2*10^8 operations.
•  » » » » » 4 years ago, # ^ |   0 10^7 * ( log(10^7) ) == 7 * log( 10^7 ) ( Base 10 )10^7 * ( log(10^7) ) is approx 2 * 10^8 ( Base e )Are STL operations base 10 or base e as both gives different results?Yeah I realised that earlier from comments above and made it AC after changing variable maa threshold.
•  » » » » » » 4 years ago, # ^ |   0 I think the most of the time we deal with base 2 logarithms. Nobody bothers to mention the base unless its different from 2 (Correct me if im wrong). Since sets are usually implemented as red-black trees (according to cpp reference) i believe the base is equal to 2.
•  » » » 4 years ago, # ^ |   0 I passed pretests in O((n+m)logM), but it was a tough battle. Input/Output took the most of time. TL was too strict imo.
•  » » » 4 years ago, # ^ | ← Rev. 2 →   +5 My solution passed pretest easilyUPD And it passed all tests in around ~1 sec
•  » » 4 years ago, # ^ |   0 Strange, my solution which is O(Xlog(N)) passed, where X = 1e7http://codeforces.com/contest/767/submission/24774891
•  » » » 4 years ago, # ^ | ← Rev. 3 →   -8 Maybe judge data was weak.. I don't see any number fi, si being 107 in the tests. I can see that there are maximum fi, si ≤ 9 × 105 :| Then O(x log n) passes simply. Also even if x = 1e7 then it can pass also :) O(1e7 log 1e7) O(2 * 1e8)
•  » » » 4 years ago, # ^ |   0 Lucky you optimizing I/O operations... cannot do this in C#... :P
•  » » 4 years ago, # ^ |   +1 Yeah, time limit in D was too strict. Submited using : Binary Search and Sorting : TLE on test 8 24776219 Binary Search and Two Pointer with cin/cout : TLE on test 9 24776253 used scanf/printf : AC 24775689
 » 4 years ago, # |   +1 Hard Problem set, but atleast now I learn how to use set :)
 » 4 years ago, # |   +28 When you find out your solution to B is wrong 1 minute before the contest ended... :( I have a feeling many B solutions will fail system testing...
 » 4 years ago, # |   0 Nice problemset. A-C were awesomem very good tasks
 » 4 years ago, # |   +8 B is hardest than DLogic R.I.P
•  » » 4 years ago, # ^ |   0 may be they confused Div2 B with Div1 B :D
•  » » 4 years ago, # ^ |   0 I'm sure you meant "harder" instead of "hardest" :)
 » 4 years ago, # |   0 Maybe it should be Div1 contest istead of Div2 ? :)
 » 4 years ago, # |   +14 Guys! English!! What the heck with problem C. I understood the problem from context, not from the description. Please don't use translators, ask someone who speaks English well to translate statements.
•  » » 4 years ago, # ^ |   0 I understood it from the picture :D :D Yeah, the statements suck a lot.
•  » » » 4 years ago, # ^ |   0 The worst was understanding the input. They interchanged lamps with wires throughout the statement.
•  » » 4 years ago, # ^ | ← Rev. 2 →   +17 This sentence in problem D : "The main issue Olya has is the one of buying new cartons."
•  » » » 4 years ago, # ^ |   +2 RIP...English.
•  » » » 4 years ago, # ^ |   0 This sentence in problem B : "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)." I got 1 wrong answer before I realized, the receptionist leaves exactly at tf, even if somebody's request is partially completed.
 » 4 years ago, # |   0 Was problem C greedy tree dp? My approach was to find a subtree of weight of dp[root]/3 and remove the weight of that subtree from its ancestors' weights. Then I try to find another subtree that has weight of dp[root]/3 and we are done. Code: LinkIs this approach correct?
•  » » 4 years ago, # ^ |   0 Yes.
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 In addition, the height of the firstly found subtree should be highest possible, so that we can increase the chance finding the second one.
 » 4 years ago, # |   0 How to solve C? I am getting WA on pretest 8 and 10.My approach -> If totalheat is not divisible by 3 return -1. Check if we can find two subtree of totalheat/3 then return those 2 values. Check if we can find a subtree with heat totalheat/3 and and it's parent with heat 2*totalheat/3 then return parent and that node. Else return -1.
•  » » 4 years ago, # ^ | ← Rev. 4 →   +3
•  » » 4 years ago, # ^ |   +4 The general idea is correct but your solution fails at both cases. You need to check that two subtrees of weight totalheat / 3 do not intersect and checking that immediate parent has weight 2 * totalheat / 3 is not enough — it could be parent's parent that has the weight 2 * totalheat / 3.
•  » » 4 years ago, # ^ |   +1 While calculating weight of subtrees, whenever weight of a subtree equals totalheat/3 push it into ans vector and return 0, because it will not be contributing in it's parent. It will handle the removal of that subtree. 24775716
 » 4 years ago, # | ← Rev. 2 →   +12 The problem-set was nice, but I feel that the difficulty levels of the questions was jumbled up. I found A
 » 4 years ago, # |   0 Can someone tell me why printing 16 gets WA on problem B pretest 2? I think I miss something in the statement but it says: "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)."
 » 4 years ago, # |   +48 Now you know why there are 8 writers: we need people to draw the cartoon and to write stories. :P
•  » » 4 years ago, # ^ |   +21 Maybe next time we will need people to properly explain these stories in English :D
»
4 years ago, # |
+88

# 398 (Div.2̶ 1)

 » 4 years ago, # |   +12 i am not sure if this was a div2 round or div1 round sorry to say that but it was one of the worst rounds i have ever seen here
 » 4 years ago, # |   +4 good contest for DIV I contestants, Div II contestants RIP
 » 4 years ago, # |   +99 My first DIV1 contest.
 » 4 years ago, # |   -19 C was awesome...D was a little easy for a D problem (they should have been swapped)I didn't read B but judging of the number of people who have solved it it must be really hard for a B problemThe statements were rubbish..they were way longer than they needed to be (that's why I didn't solve B...skipped it after seeing the statements)But all in all the contest was great.(don't downvote me guys it's just my opinion):)
•  » » 4 years ago, # ^ |   +15 it was great because you didn't read problem B but who read problem B and tried to solve wasted too much time while problem D was easier to solve
 » 4 years ago, # | ← Rev. 2 →   +3 It so frustrating when you solve problem but can't pass tests because standard reading method, you used all the time, doesn't read fast enough for this input. I have linear time solution for C but probably reading method I use in my C# solution too slow. Now I think that string.Split() is just too slow for this problem. Don't enjoy such contests.
•  » » 4 years ago, # ^ |   +3 I have the same I/O timeout problem for problem D also for C#. Spent the entire contest time trying to figure out why I am getting timeout on test 9.I also don't welcome this situation. The official answer was that "It is not guaranteed that a solution exists for all languages". Well, c'on... I have seen some folks with solutions in C++ and still getting timeout on test 9, probably for the same reasons (since some are Div1).I would like to thanks the organizers for setting up the contest of course, really enjoyable, but cannot but feel disatisified with taking a big rating hit for trying to solve a problem which is unsovable given the time limits without optimizing I/O. Really, this is a known issue. My opinion is that the limits should have been increased to 3 or 3.5 seconds to allow for such reads. This will still not make an n^2 fit but will allow enough time to I/O...Didn't even have time to read the others except B (which also has a very long text...). My opinion is that weather this particular contest should be rated should come into question.
 » 4 years ago, # | ← Rev. 2 →   +5 Am I the only one who practice translating hardly?
 » 4 years ago, # |   0 Lowest solved, highest wrong answer :P "long live 398 Div#2"
 » 4 years ago, # |   +7 Be stucked in Problem B. RIP my rating. :<
 » 4 years ago, # |   -10 Contest should be unrated.Bad translations, long statements and very hard B.
 » 4 years ago, # |   +19 is it rated?!
•  » » 4 years ago, # ^ |   +28 only for Div.1 participants ;)
•  » » » 4 years ago, # ^ |   +10 No please:) I just resubmit without thinking when i stuck at some problems. Many pretests failed including failing pretest 2 :)
 » 4 years ago, # |   -23 Vote here. They can make contest unrated.
•  » » 4 years ago, # ^ |   0 I liked the problems. They were harder than usual, but they were harder for everybody, not just you. Why make it unrated?
•  » » » 4 years ago, # ^ |   +6 I would vote for unrated because there were several issues with timeouts due to I/O operations taking to long (for example in C# for problems D and I understand also C).I would really have enjoyed this contest especially due to the harder problems however if despite a sound solution I have to spend the entire contest time to figure out I get timeouts due to I/O, then.. I would go for unrated.
•  » » » » 4 years ago, # ^ |   0 Maybe you should avoid using slow languages in competitions.
•  » » » » » 4 years ago, # ^ |   +5 Thanks! Never encountered this problem until now though. Usually the limits are better thought to allow even C# and Java solutions to pass.
•  » » 4 years ago, # ^ |   +13 do not worry, your name will fit your new rank haha
•  » » » 4 years ago, # ^ |   0 I'm pupil now. LOL
 » 4 years ago, # |   +3 Fastest Systest ever... no wonder, since there was so low total number of submissions.
 » 4 years ago, # |   0 How to solve E?
 » 4 years ago, # | ← Rev. 2 →   +43 4 6 20 1 1 12 2 2 2 2 2Are cases like these not in system tests? At least two of my friends will output -1 for this test but I believe all the cartons of milk can be drank, right?In fact, my friend will fail if there is no 0 in the first line but a solution still exist. This apparently is not in the systests however ==
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 Shouldn't the answer be -1? We can drink carton 1 and 2 that are inside fridge on day 1 but how can we drink carton 3 and 4 on day 2?
•  » » » 4 years ago, # ^ |   +10 You can just drink them lol. They are not expired yet.
 » 4 years ago, # | ← Rev. 2 →   0 A. Pretest 5 should be a systest! There should be more possibilities to hack.
 » 4 years ago, # | ← Rev. 2 →   0 A DIV2 guys can some one tell me why i got TLE on test 23 ? submission
 » 4 years ago, # | ← Rev. 3 →   +5 problem B test case 3 :input:7 14 321 2output:13answer:0statement says :The receptionist spends exactly t minutes on each person in the queue. If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves).my output should be correct
•  » » 4 years ago, # ^ |   0 Yes I have the same question too for my submission. Please someone to answer us.
•  » » 4 years ago, # ^ | ← Rev. 2 →   +5 Your output is 13, while if Vasya visit t = 13, the receptionist would not serve Vasya as the reception cannot close before tf = 14 because it requires 3 minutes serving Vasya (from t = 13 to t = 15).
•  » » » 4 years ago, # ^ |   +5 Yea but the statement says "(other than the one he already serves)."
•  » » » » 4 years ago, # ^ |   0 Which means someone he is already serving, and not people who are in the queue waiting.
•  » » » » 4 years ago, # ^ |   0 I think the receptionist will choose to serve a new comer or not, based on whether if the receptionist can serve the new comer fully before the close of receptionSo for "the one he already serves", they mean those being fully served as the receptionist will choose not to serve the new comer if the new comer cannot be fully served.
•  » » » » » 4 years ago, # ^ | ← Rev. 2 →   0 Please skip this comment
•  » » » » 4 years ago, # ^ |   0 Yeah, but the statement also says "(so that (tf - 1) is the last minute when the receptionist is still working)". So (I'm also not happy to admit), from the statement, the answer to case 3 is indeed 0. Dammit!
•  » » 4 years ago, # ^ |   0 same problem here i was stuck with that test case
•  » » 4 years ago, # ^ |   0 Let's rephrase the last sentence : "The receptionist will not accept new customers during last t minutes, but she will finish serving those who came until time t_f - t" I misunderstood this statement during contest as well, but fixed my code easily with this new insight (compare 24774069 and 24775470).IMO, pretest 3 should have simply been added to problem statement and all would be much better.
•  » » » 4 years ago, # ^ |   0 I see. Thanks for the answer. Personally I am not so good in english and I find the translation terrible. I suppose that many others feel the same and that this bad translation costed to us time and rating.
•  » » 4 years ago, # ^ |   0 I faced the same problem this system test is the worst of all
•  » » 4 years ago, # ^ | ← Rev. 4 →   0 My solution failed system tests just because of this 'error' in the problem statement. Maybe this is one of the reasons why B had so many successful submissions.
•  » » » 4 years ago, # ^ |   0 KAN MikeMirzayanov Could you please provide some clarification as to what that statement meant? Some other used asked during the contest and he was clarified what it meant. Should not that have been an announcement for everyone?
•  » » » » 4 years ago, # ^ |   +10 As others mentioned, the statement is: "When there is t minutes before tf, the receptionist stops serving new visitors, and only finishes serving the one which is already being served."
•  » » » » » 4 years ago, # ^ |   0 Unfortunately, I do not see that line in problem statement. All I see is "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)." And I do not think many people would agree that both the statements mean the same thing. The problem statement should have been more clear :)
•  » » 4 years ago, # ^ |   0 This part of the statement explains why the answer to case 3 is 0:"(so that (tf  -  1) is the last minute when the receptionist is still working)"
 » 4 years ago, # |   +5 System test gives WA for all submission for problems D &E
•  » » 4 years ago, # ^ |   0 I got AC for D...
•  » » » 4 years ago, # ^ |   -10
•  » » » » 4 years ago, # ^ |   +16 Don't worry, you still have your another Div.1 account : repeating
•  » » » » » 4 years ago, # ^ |   -12 Is it forbidden to have 2 accounts on CF !!
•  » » » » » » 4 years ago, # ^ |   +6 OMG, Question of the year!!!
 » 4 years ago, # | ← Rev. 2 →   +26 WTF is wrong here, it says my D is accepted but in standings it seems like it failed — http://store.picbg.net/pubpic/6A/71/96070172827f6a71.png?UPD: That's the case for everyone, now I see...
•  » » 4 years ago, # ^ |   0 Seems like it affected the Rating changes too.
 » 4 years ago, # |   0 I do not know why everyone says that problem B was difficult, it was just a simulation and greedy, for me it was more difficult to solve problem C
 » 4 years ago, # |   0 This was the worst contest for me — I began with C, did it. Then tried D, but failed on some pretest. At this point I had just 20 minutes left, so I went back to A and B. I got A, but with a very low score, then wrote B. I had a small bug, which I found. I was just about to click submit when the contest ended(I had already selected the file). In the end, my C fails system test. :(((
 » 4 years ago, # | ← Rev. 2 →   0 I've got a question. This is test 4 for B problem:30 70 10330 32 35Why is the answer 60? Isn't the queue supposed to close a tr — 1 = 69?
•  » » 4 years ago, # ^ |   +6 If Vasya visits at t = 60, Vasya is served from t = 60 to t = 69 which consists of 10 whole minutes. So the reception can close at tf = 70.so that (tf - 1) is the last minute when the receptionist is still workingBy this, the receptionist still works at t = tf - 1 = 70 - 1 = 69.
 » 4 years ago, # | ← Rev. 4 →   0 What's going on with the standing? They are giving fail in spite of passing? NVM, it got fixed
 » 4 years ago, # |   -40 What kind of time limit has been set for the 2nd problem ?What fool did it ? Who is this foolish person who set this problem ?Submissions : Java (During the contest), MLE : http://codeforces.com/contest/767/submission/24771836 C++ (After the contest), AC within 1310 ms : http://codeforces.com/contest/767/submission/24775207 Such a negligent attitude is rather bad, and I dont think deserves a place on CF. The two codes are 150 % identical, expect they differ only and only in language .
•  » » 4 years ago, # ^ |   +10 Dude think before calling the problem setters foolish. They are doing this voluntarily and you should be thankful to them instead. Sometimes there are some negligences, but you shouldn't call them foolish at least.
 » 4 years ago, # |   0 Is this proper test for B? Is only Vasya can come at midnight (at time 0) ? 0 7 2 4 0 0 0 6
•  » » 4 years ago, # ^ |   0 tgeed yahked bgan ci haha
 » 4 years ago, # |   0 I was deceived by the unusual input of C which is tree data
 » 4 years ago, # | ← Rev. 4 →   +5 In problem B, for the 3rd pretest: 7 14 3 2 1 2 My answer was 13. Why is it wrong? In the condition it states: If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves), so I assumed that means he should enter before tf but doesn't need to get out before tf. Either I'm missing something or the condition was wrong.Whoops, someone already posted the same question, sry.
•  » » 4 years ago, # ^ |   0 same problem here
•  » » 4 years ago, # ^ |   +2 MikeMirzayanov please look into this
•  » » 4 years ago, # ^ |   +5 If you go at time 13, the receptionist would stop working within 3 minutes(actually after 1 minute the person will stop working). So you can't get served.
•  » » » 4 years ago, # ^ |   +6 (other than the one he already serves), this means that he keeps serving the one she already servers.
•  » » » » 4 years ago, # ^ |   0 No, that means, say, assume you go at time 9 and start served. At time 11 the receptionist would stop working within 3 minutes, but the server continues to serve you.
•  » » » » 4 years ago, # ^ |   0 I think the receptionist will choose to serve a new comer or not, based on whether if the receptionist can serve the new comer fully before the close of reception.
•  » » 4 years ago, # ^ |   +2 You won't be served if you come at 13, because the queue closes T seconds before the end.
•  » » » 4 years ago, # ^ |   0 (other than the one he already serves), this means that he keeps serving the one she already servers.
•  » » » » 4 years ago, # ^ |   0 But he comes after than T seconds before the end, so the queue is already closed. He isn't even start getting the passport.The idea behind the phrase is the following one. Suppose T = 5, Tr = 20. If you come at 13 seconds, you will be served even if the queue is supposed to close at 15. If you come at 18, however, you aren't served.
•  » » 4 years ago, # ^ |   0 Oh yeah, I just read that wrong, my bad, missed the "within t minutes" part. I should buy new glasses xd.
 » 4 years ago, # |   0 In problem B This test case: 7 14 3 2 1 2The output of the judge is 0 however i am printing 13 and he tells me wrong why he can come at min. 13 noone is there so he can enter as the 2nd one finishes at min. 13
 » 4 years ago, # | ← Rev. 2 →   +11 I got 17th place, but it is showing that I got 49th place.
•  » » 4 years ago, # ^ |   +1 I finished 316 , but rating update says that I finished 2236... looks like "D" was not considered in rating update somehow
•  » » » 4 years ago, # ^ |   +1 same here I finished 263 but says that I finished 2017
•  » » 4 years ago, # ^ |   +1 Same problem here. It looks like the rating was calculated before system testing.
•  » » 4 years ago, # ^ |   +1 Same here. This shows I got 108th place while this shows I got 347th place.
•  » » 4 years ago, # ^ |   0 Looks like cf has broken.
•  » » 4 years ago, # ^ |   0 same here !
•  » » 4 years ago, # ^ |   0 17th div2 participants , 49th with div1+div2
 » 4 years ago, # |   +16 That moment when only A is accepted but I have new best rating lol.
 » 4 years ago, # | ← Rev. 2 →   +22 MikeMirzayanov Rating change is weird.
 » 4 years ago, # |   +3 Why does it say I am in position 656 or so if I'm in position 97? My rating went down when it should have gone up. Please help
 » 4 years ago, # |   0 Why is everyone's D on the scoreboard wrong?In status I see I have accepted it.But the rating have changed according to the scoreboard .
•  » » 4 years ago, # ^ |   +3 And also E!!!
 » 4 years ago, # |   0 MikeMirzayanov how come the same test case pass in the pre-test and fail in the system test, my solution is anyways has a bug but I'm just curious. http://codeforces.com/contest/767/submission/24762072
 » 4 years ago, # |   +43 Cheaters On Problem D: Hasan: Submission M.A.H.M.O.O.D: Submission
•  » » 4 years ago, # ^ |   -22 yeah but I got AC and Hassoony got TLE on test 9 Problem D is an easy binary search with greedy for a check function it's easy to have similar codes because the problem is easy I mean for problems like A and B in contests almost everyone submits a similar code.
•  » » » 4 years ago, # ^ | ← Rev. 2 →   +41 You got AC with 1996ms. He got TLE because he changed everything to long long, while you simply added unsigned in some places. Don't Try to be smart :)))).
•  » » » 4 years ago, # ^ |   -26
•  » » 4 years ago, # ^ |   +12
•  » » » 4 years ago, # ^ |   +11 Thanks for being very responsive.
•  » » » » 4 years ago, # ^ |   0 Be like CheaterKiller :D
•  » » 4 years ago, # ^ |   0 So, why have you created a fake account? I can't believe, that you are afraid of them.
•  » » 4 years ago, # ^ |   +3
 » 4 years ago, # |   +1 hi .. there is a problem in standing now .. my soultion for D is accepted and apper on my standing -1 !! and i haven't points and my rate is decrease !! how !!??
 » 4 years ago, # |   +1 on the contest standings it says that I ranked 103(without unofficial participates) but on my profile it shows that the last contest I did (#398) I ranked 289Can somebody look into this because it will effect my rate a lot ?
•  » » 4 years ago, # ^ |   +3 this might help http://codeforces.com/blog/entry/50469?#comment-343949
 » 4 years ago, # |   +15 Seems the problem with D&E standings display also affected the rating changes... Is there anyone fixing this?
 » 4 years ago, # |   +19 Ahhhhhh，What's the matter? I think my rating is too high.
 » 4 years ago, # |   +9 my submission of problem D showed accepted in "My submission",while the final score is calculated without the score of problem D. what is the problem?
•  » » 4 years ago, # ^ |   +1 same here !!
 » 4 years ago, # | ← Rev. 2 →   +3 Question C: That moment when you realize that abs(1/3 * total) < abs(total) doesn't hold if total = 0.EDIT: total -> abs(total)
•  » » 4 years ago, # ^ |   0 And it's even worse when total got negative.
•  » » » 4 years ago, # ^ |   0 Oops, I meant abs(1/3 * total) < abs(total).
•  » » 4 years ago, # ^ |   +8 Or when you realize there's no wire above the root.
•  » » » 4 years ago, # ^ |   0 Same...
 » 4 years ago, # |   +3 When you solved 1 problem but your rating still increases
•  » » 4 years ago, # ^ |   0 Same....
 » 4 years ago, # |   +12 I want to know why my rating -48,In this conteset my rank is 124, but the profile's rank is 980,why ? Sorry,my English isn't well
 » 4 years ago, # |   +60 this happened because you didn't say thanks to MikeMirzayanov
 » 4 years ago, # |   +31 Strange rating change. It seems like problem D is not considered.
•  » » 4 years ago, # ^ |   0 same here !
•  » » 4 years ago, # ^ |   +5 yes...but why?
•  » » » 4 years ago, # ^ |   +11 Hope it will be recovered. You can't lose the chance to be purple.
•  » » » » 4 years ago, # ^ |   +5 thank you~ and you can rise more :)
 » 4 years ago, # |   +5 Problem B statement is wrong. "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)." I submitted without considering above statement, my solution got accepted.
 » 4 years ago, # |   +10 More points but less rating increase Me
 » 4 years ago, # |   0 If I know about such complicate B task I would spend all time solving D, segment tree is much more attractive for me :)
 » 4 years ago, # | ← Rev. 2 →   -38 .
•  » » 4 years ago, # ^ |   +8 The contest is already unrated for you!
•  » » 4 years ago, # ^ |   +10 Which test is not correct? Easy to say sth. like this without mentioning a specific test
•  » » » 4 years ago, # ^ |   0 7 14 3 2 1 2 Answer should be 13 instead of 0. Problem is occuring because of wrong problem statement. "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)." 
•  » » » » 4 years ago, # ^ |   0 even i had that confusion and had 4 WAs thanks to that. then i asked in the question section and got clarified.As codeforces's popularity is growing day by day, I think they should take an effort to provide better English statements.
•  » » » » » 4 years ago, # ^ |   -11 Either round should be unrated or submissions must be retested based on the problem statement.
•  » » » » » » 4 years ago, # ^ |   0 If it gets retested, a lot of AC ones will get WA. I don't think this happened for the first time in CF. It happened a lot in the past too and none of those round was declared unrated...
•  » » » » 4 years ago, # ^ |   0 I fail to understand why it should be 13? If you arrive at 13, you won't be served, because t_f is 14 and 13+3 is > 14?? This complies with the problem statement.
•  » » » » » 4 years ago, # ^ |   0 "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)." This implies that even if you arrive at 13 you will be served. 
•  » » » » » » 4 years ago, # ^ | ← Rev. 4 →   0 No, he will already stop serving new visitors after 14-3 = 11 because then current time + t > 14! This is what it implies...
•  » » » » » » 4 years ago, # ^ | ← Rev. 2 →   0 "He already serves" not "he is serving". There is nothing wrong with the statement. Check your English.
•  » » » » » » » 4 years ago, # ^ |   0 Okay
 » 4 years ago, # | ← Rev. 2 →   +32 Please, next time spend your energy on writing more clear problem statements instead of drawing pictures to all questions.
 » 4 years ago, # |   0 well, feel lucky not to compete in this round- - seems easy but actually…er…you all know now.
•  » » 4 years ago, # ^ |   0 after read the problems carefully…regret? D & E seems extraordinarily easy……than B
 » 4 years ago, # |   +3 How is the rating calculated? I ranked 21st in the contest,but the rating dropped by 20! I'm the only one whose rating dropped among the top 88 people,including those whose ratings were initially higher or lower than me.In particular,there are many people whose initial ratings were higher than me,scored lower than me in this contest,but their ratings rose sharply!How could this happen?
•  » » 4 years ago, # ^ |   0 I hope my ratings won't get decreased now -_-
 » 4 years ago, # |   +65 We know about the issue with ratings, they will be rolled back and then updated properly. Don't worry.
 » 4 years ago, # |   0 I quit , i need my Rate back !
 » 4 years ago, # |   0 In pC, when I hacked others with 4 0 1 1 -1 2 1 3 -1 The verdict of the hack is an unexpected error...... Just wonder whether this kind of testdata are already in the system test or not...
 » 4 years ago, # |   +9 Why rating changes is not logical ....
 » 4 years ago, # |   0 why？ same original rating , higher rank,lower rating? feel sad QAQ!
 » 4 years ago, # | ← Rev. 2 →   0 LOL
 » 4 years ago, # |   +13 The problems D&E were even not considered in standings on my IE ,but fortunately now it has been fixed .Just waiting for the fixing of rating changes now .
 » 4 years ago, # |   0 Hard but interesting problem set. Thanks for your work and I also appreciate the strong pre-tests!
 » 4 years ago, # |   0 Can someone provide me some good questions for practice on DP on trees.?
•  » » 4 years ago, # ^ |   0
 » 4 years ago, # |   +22 KAN How this Code get AC ?!test: 3 1 2 1 1 1 2 Code Output : -1 Expected Output : 1 1 
•  » » 4 years ago, # ^ |   0 LOL
•  » » 4 years ago, # ^ |   0 this code and this code have the same issue
 » 4 years ago, # |   +3 I think score distribution should be change
 » 4 years ago, # |   -13
 » 4 years ago, # |   +1 KAN How can this code http://codeforces.com/contest/767/submission/24788498 24788498 get AC test case 5 20 4 4 0 0 10 14
•  » » 4 years ago, # ^ |   +1 This is invalid test The third line contains positive integers in non-decreasing order the time of the visitors must be positive, it can't be 0
 » 4 years ago, # |   +23 Wow! I got three 98 in Codeforces Round #398!
 » 4 years ago, # |   0 i think the problem is good , not only degree of difficulty , but also the trick . forever , the difficulty classification is so bad , the D is easier than B and C i think A D B C is better than the round .
 » 4 years ago, # | ← Rev. 2 →   +1 Solution for B: ~~~~~ ~~~~~ long min = 0; long mins = ts+t; int pl = 0; for (; pl
 » 4 years ago, # | ← Rev. 3 →   0 I wonder why this 24795199 got WA. I need help.
•  » » 4 years ago, # ^ | ← Rev. 2 →   +3 your code fails in this testcase:50 11 -12 13 14 1 I think you are marking more than 2 vertices, because you are cutting the tree more than 2 times. I added another condition (num != 2) to your if at the dfs and it passes test 9.http://codeforces.com/contest/767/submission/24806874
•  » » » 4 years ago, # ^ |   0 I got it.Thanks！
 » 4 years ago, # |   +3 I found a test case which is 6 2 -1 3 1 0 1 3 -1 4 1 5 -1 Both my friends passed the problem, but have different output, their submission are 24775420, 24775421 the first one output 2 5, which I think is correct, and the second one output -1 Do the sys test miss the test case like this?