### _kun_'s blog

By _kun_, 7 months ago, translation, ,

Hello!

Right now happens the first tour of the Open Olympiad in Informatics, and tomorrow will be the second one. This contest is prepared by Moscow Olympiad Scientific Committee that you may know by Moscow Team Olympiad, Moscow Olympiad for Young Students and Metropolises Olympiad (rounds 327, 342, 345, 376, 401, 433, 441, 466, 469, 507, 516, 541)

Open Olympiad consists of the most interesting and hard problems that are proposed my a wide community of authors, so we decided to conduct a Codeforces regular round based on it, which will happen Mar/08/2019 12:05 (Moscow time) and will be based on both days of the Olympiad. Each division will have 6 problems and 2:30 hours to solve them.

We kindly ask all the community members that are going to participate in the competition to show sportsmanship by not trying to cheat in any manner, in particular, by trying to figure out problem statements from the onsite participants. If you end up knowing some of the problems of Moscow Open Olympiad (by participating in it, from some of the onsite contestants or in any other way), please do not participate in the round. We also ask onsite contestants to not discuss problems in public. Failure to comply with any of the rules above may result in a disqualification.

Problems of this competition were prepared by V--gLaSsH0ldEr593--V, isaf27, Flyrise, _kun_, GlebsHP, ch_egor, Zlobober, qoo2p5, grphil, achulkov2, Schemtschik, akvasha, mingaleg, V--o_o--V, wrg0ababd, guided by ch_egor, _kun_, GlebsHP, Zlobober and Helen Andreeva.

Problems for second division were prepared by KAN and MikeMirzayanov, to who we also want to say thanks for the Codeforces and Polygon systems.

Good luck everybody!

UPD: Congratulations to the winners!

Div.1

Div.2

The editorial will appear soon

UPD: The editorial

• +234

 » 7 months ago, # | ← Rev. 2 →   +24 You mean round #545?Edit: got fixed.
•  » » 7 months ago, # ^ |   -13 stop flaming people for no reason, you're not perfect either!
•  » » » 7 months ago, # ^ |   0 The title was #544, and I pointed it out so they would fix it.
 » 7 months ago, # | ← Rev. 2 →   0 i wish this contest will be my chance to become candidate master
•  » » 7 months ago, # ^ |   +34 I wish this comment is your chance to get out of the negative :p Good luck bro <3
 » 7 months ago, # |   +402 Just be careful with any streams.
•  » » 7 months ago, # ^ |   -10 ROFL
•  » » 7 months ago, # ^ |   +558
•  » » » 7 months ago, # ^ |   +76 The editorial you linked is unavailable in my country, so at least they have that handled.
•  » » » 7 months ago, # ^ |   -133 Link redirects to "Rick Astley — Never Gonna Give You Up (Official Music Video)".
•  » » » » 7 months ago, # ^ |   +75 You must be fun at party
•  » » » » » 7 months ago, # ^ |   -13 parties*
 » 7 months ago, # |   +45 it is like asking thieves not to steal.
 » 7 months ago, # |   +48 Hopefully this contest will not end up with "Let's solve problem just for fun"
 » 7 months ago, # |   -14 is it rated?
•  » » 7 months ago, # ^ |   +10 if god loves me nope
 » 7 months ago, # |   -45 Another potential unrated round :)
 » 7 months ago, # |   +4 Hope not two unrated contest happening in a week..
 » 7 months ago, # | ← Rev. 2 →   0 Looking forward to solving a problem by kun :D
 » 7 months ago, # |   +37 We should believe in Codeforces that they won't make mistakes any more. (ง •_•)ง
 » 7 months ago, # | ← Rev. 2 →   -59 Not a suitable contest timing for Indians. :(
•  » » 7 months ago, # ^ |   +7 Why? It'll be at 2:30 pm. I don't see a problem.
•  » » » 7 months ago, # ^ | ← Rev. 2 →   0 oh, so poor
•  » » » » 7 months ago, # ^ |   0 He meant IST (Indian Standard Time).
 » 7 months ago, # |   -29 Why everyone should know that this contest is based on Moscow Open Olympiad in Informatics? I think it is better to hold information like this in secret or announce it after the end if the cheating is possible.
•  » » 7 months ago, # ^ |   +13 Well you need to be able to tell people that know the Moscow Open Olympiad problems not to take this contest. There's no easy way to tell people this without outright saying that the contest shares at least some problems.
•  » » » 7 months ago, # ^ |   -36 I believe there are better ways than make it public. Even if you know the solution but the statement is changed it will take some time to realize it. But there won't be enough time (and purpose) to spread it across the community.
 » 7 months ago, # |   +26 Best contest time for Japanese! Yeah!!!
•  » » 7 months ago, # ^ | ← Rev. 2 →   +38 And for Chinese too :D
•  » » » 7 months ago, # ^ |   +13 但是横跨了我的吃饭时间
•  » » » » 7 months ago, # ^ | ← Rev. 2 →   +8 But we cooked it while eating instant noodles.（fog
•  » » » » » 7 months ago, # ^ | ← Rev. 3 →   +5 So this is the reason that you only solved one problem?
•  » » » » » » 7 months ago, # ^ |   +8 orz sxz，i have FSTx2 on this contest
 » 7 months ago, # |   -18 ╮(╯_╰)╭, just have fun~
 » 7 months ago, # |   +22 When will the editorial be published?
 » 7 months ago, # |   +127 Meanwhile in my timezone
 » 7 months ago, # |   +32 Scoring distribution?
 » 7 months ago, # |   0 getting "you have already submitted this code" for all submission I'm making .-.
 » 7 months ago, # |   0 CF rounds quality is coming down everyday and we see more and more(unbalanced,unrated,unusual,...) rounds...
•  » » 7 months ago, # ^ |   -10 Today's contest is easy as I raised 5 rank.
 » 7 months ago, # |   -11 ewww moscow
 » 7 months ago, # |   +3 Can't solve last 2, but all problems were interesting. :)(Also need to go back to sleep now).
 » 7 months ago, # |   +94
 » 7 months ago, # |   +13 A few unbalanced round. (maybe not a few).
 » 7 months ago, # |   +12 Is it only me or every one that thought this contest was unbalanced?
•  » » 7 months ago, # ^ |   +1 I dont know, i didnt have any ideia to solve b, c or d
 » 7 months ago, # |   +27 Kudo for the pretests :DBtw, anyone have any ideas of pretest 16 of Div1C? :D
•  » » 7 months ago, # ^ | ← Rev. 2 →   +8 I fixed RE16 with #pragma comment(linker, ”/STACK:36777216“) (using MS C++17)
•  » » » 7 months ago, # ^ |   +8 Woah, that doesn't work for me. Must be some other segmentation fault I haven't figured out :
 » 7 months ago, # |   +6 Saw a bug in my A after I locked in. Feelsbadman
 » 7 months ago, # |   +1 How do you do Div. 2 B? :O
•  » » 7 months ago, # ^ |   0 Is it just some nasty casework?
•  » » » 7 months ago, # ^ |   0 No just find all four types and use two for loops such that you check all the possibilities, by using the given conditions and two FOR loops you'll be able to check all the possibilities if nothing satisfies, print -1.The four types are a[i]=0 && c[i]=0 a[i]=1 && c[i]=0 a[i]=0 && c[i]=1 a[i]=1 && c[i]=1 Now use two FOR loops to check the number of type 2 people and number of type 3 people in group 1, then you can figure out type 4 needed.
•  » » » » 7 months ago, # ^ |   0 but i can't solve this problem by this way,could you explain it more clearly? Thanks
•  » » » » » 7 months ago, # ^ |   0 i got it,thanks
•  » » » » » 7 months ago, # ^ |   0 You can go through My submission
 » 7 months ago, # |   +3 I tried to hack one of the solution, I uploaded script (which generates testCase) several times, but all the time, there was Generator compilation error. Could you teach me how to hack using generator scripts?
•  » » 7 months ago, # ^ | ← Rev. 3 →   +3 You must strictly follow the format of the input data up to spaces and line breaks; For example, in problem Div2 A script generator would be #include using namespace std; int main(){ int n = 100000; cout << n << endl; cout << 1 << " "; for (int i = 1; i < n; i++){ cout << " " << 1; } cout << endl; return 0; } make sure that you have cout << endl; in the end of the code and spaces in right place; here is a generator that will not compile (because of unnecessary spaces int the end of line) for (int i = 0; i < n; i++){ cout << 1 << " "; } 
 » 7 months ago, # |   +3 How to solve Div2. B?
•  » » 7 months ago, # ^ |   +17 I solved (pretest passed) it this way: Let a, b, c, d be number of index with (0, 0), (0, 1), (1, 0), (1, 1) respectively. If you select A, B, C, D of the types in the order, then these should hold: A + B + C + D = N / 2 and C + D = b - B + d - D. Using the second one you can say that A - D = N / 2 - b - d.Now, you can brute force on A, D and whenever you find one brute force on B, C.
•  » » » 7 months ago, # ^ |   0 How would you account for the complexity of the solution ?
•  » » » » 7 months ago, # ^ | ← Rev. 2 →   0 O(N2) with very low constant. I think it can be optimized to O(N) if you find A, B, C, D mathematically instead of brute-forcing.
 » 7 months ago, # |   +14 That moment when you solve C and D but cant solve B :(
 » 7 months ago, # | ← Rev. 2 →   0 Was Div2 F(Div 1D) only simulation of tortoise and hare algorithm?
 » 7 months ago, # |   +74 It took me 30 minutes to realize that in C the tour can last more than one week. Granted, if that wasn't the case, the problem would be equivalent to Hamiltonian path, and in the second sample the path lasts 6 days, but I still think that the problem was unclear. Nowhere in the statement does it say that the tour can last more than one week :/
•  » » 7 months ago, # ^ |   +16 I had the same problem with not understanding it at once.
•  » » 7 months ago, # ^ |   +15 Exactly, I was scratching my head for long time as well figuring out why are they asking me variation about k-path problem which I know is pretty hard to solve. Need to look up explanation of sample as well.
 » 7 months ago, # | ← Rev. 2 →   +57 Thanks for an amazing contest!Solution for D:Move (0, 1) and (0) (2 operations) while their positions don't coincide. If we have done k such operations we must have 2k ≡ k(mods), . Now start moving all the pieces together. After t moves they all will be at the desired point: as 2k + t ≡ t(mods), pieces 0, 1 will get there, while 2, 3, ..., 9 will obviously get there for the first time.
•  » » 7 months ago, # ^ |   0 How do we determine t?
•  » » » 7 months ago, # ^ |   0 The first value after which all pieces are at same point
•  » » » » 7 months ago, # ^ |   +8 Oh shoot what a retard i am thank you
•  » » 7 months ago, # ^ |   +42 D was a very nice problem, kudos to the author.
•  » » 7 months ago, # ^ |   0 Can you explain what this notation means?
•  » » » 7 months ago, # ^ |   +3 k is divided by s (k = 0(mods))
•  » » » » 7 months ago, # ^ |   +3 I haven’t seen that written with vertical ellipses before, so I was confused. Thank you.
 » 7 months ago, # | ← Rev. 3 →   +27 I solved A, and then I just read problem B -> C -> D -> B -> C... again and again...CF 545 made me iterator function...
 » 7 months ago, # |   -8 B on div2, is hardest B question I ever see in codeforces . what's the goal of designing such question ?
•  » » 7 months ago, # ^ |   0 It is certainly harder than C which is just knowing about ordered sets.
•  » » » 7 months ago, # ^ |   +5 Lol you don't even need ordered set. Sorted array with binary search is enough.
•  » » » » 7 months ago, # ^ |   0 :|
•  » » » » 7 months ago, # ^ |   0 I solved it with just sets...
 » 7 months ago, # |   -8 How to find t in div1D? (if I not mistaken we can find c due to fixed players on positions with index 2^i, before first time we meet fixed player)
•  » » 7 months ago, # ^ |   +5 Hint: You don't need to find it to solve the problem.
•  » » » 7 months ago, # ^ |   -8 Hmm... I thought about this but I have no clue, how to find exact point in cycle?
 » 7 months ago, # | ← Rev. 2 →   +110 Fun fact: Problem D is used as a subroutine in algorithm for subset sum in O(20.86n) time and polyspace.I have seen this on a lecture a few days ago, which explains why I was so fast in solving this problem :P.
•  » » 7 months ago, # ^ |   +10 also a subroutine in Pollard's Rho algorithm.
 » 7 months ago, # |   0 In div1C was O(N*D) the correct time complexity of the solution? I had TLE 11 witk making a graph with nodes associated with pairs of cities and days ( n*d nodes, m*d edges) What were other aproaches?
•  » » 7 months ago, # ^ |   +31 Exactly :|... Got this solution pretty fast and sank for a long time in microoptimizing it and didn't make it pass 11th test :|...
•  » » 7 months ago, # ^ |   +16 For any strongly connected graph there exists a number g such that, for every vertex v and sufficiently large k there exists a cycle of length gk which passes vertex v. Intuitively you can think about the GCD of all cycles. It is not, but something similar. If you decompose a graph into SCCs, you can calculate such g in linear time. Now you can do a DP with a state as (vertex, length mod d), and transited for every edges and SCCs. This is O((n + m)d), but the DP routine is just array scanning, so my non-optimized code runs in 0.3s.
•  » » » 7 months ago, # ^ |   -18 thank you
•  » » » 7 months ago, # ^ |   0 Good solution! I tried to solve it in this way but failed in the contest.
•  » » » 7 months ago, # ^ |   0 Good solution! I tried to solve it in a stupid way but failed in the contest.
•  » » » » 6 months ago, # ^ |   0 You are a Pinkie Pie too? And you are repeating my words!Didn't Twilight return all my clones back to the Mirror Pool, did she?
•  » » » 7 months ago, # ^ |   0 To compute that value g for every connected component you have D*(number of nodes of CC)? Can you do better than this?
•  » » » » 7 months ago, # ^ |   +5 For all cycles created by back edge take its length. For all two disjoint path created by forward edge take the difference of length of two paths. g is a gcd of them. So it is simple dfs.
 » 7 months ago, # |   +8 Even additional half an hour didn't help me to solve B and C. I guess they were hard not only for me.
 » 7 months ago, # |   0 Div1 AB may be a little bit too easy.But I just have no idea about Div1C...
 » 7 months ago, # |   +131 When I see a problem from school olympiad in which you have to optimize constant for O(dn) solution...
•  » » 7 months ago, # ^ |   0 Do you have an idea what caused "Runtime error on pretest 16" ?
•  » » » 7 months ago, # ^ |   0 Lmao, no clues at all. I just tried changing vectors to arrays
•  » » » » 7 months ago, # ^ | ← Rev. 2 →   0 Maybe its because of recursion and too much memory in stack (in my case)
•  » » » » » 7 months ago, # ^ |   0 It may be, but it should have been the case in the solution which got TL 18 as well.
•  » » » » » 7 months ago, # ^ |   +9 And it seems to be some compiler related stuff because same submission get AC on MS C++ -_-'Link
•  » » 7 months ago, # ^ |   +5 51016217, 51038646. same code, same compiler.
 » 7 months ago, # |   +15 Am I the only one that thought that D was easier than A, B, and C :)
•  » » 7 months ago, # ^ |   +9 WA on test 70 bro, FeelsBadMan
•  » » » 7 months ago, # ^ |   +7 I cry everytime :(
•  » » 7 months ago, # ^ |   +3 Yeah, you basically just have to know a O(n) string matching algorithm. At least that's the way I did it.
•  » » » 7 months ago, # ^ |   0 can you explain which algorithm u have applied!!
•  » » » » 7 months ago, # ^ |   0 I used Z-algorithm to find the longest suffix is t which is also a prefix. I learned it from here, page 247.
•  » » » » » 7 months ago, # ^ |   0 thanks bro!! i got it.
 » 7 months ago, # |   0 What is solution for C div 1 ?
•  » » 7 months ago, # ^ |   +18 Build a graph where the vertices are (u, t) where u is the node and t is the time modulo d. Then, connect (u, t) to (v, (t + 1)modd) for all edges . Compress the SCCs of this graph and do DP on DAG. The key fact is that if there is a path from (u, j) to (u, j'), then there is also a path from (u, j') to (u, j) (by going through the cycle more times), so you won't overcount cities. I had to do a lot of optimizations to get pass the pretests though, maybe there's a simpler method........
•  » » » 7 months ago, # ^ |   0 Do I also have to do DP in the SCC?
•  » » » » 7 months ago, # ^ |   0 Nope, in the new graph you can take all the vertices in an SCC if you ever reached it.
•  » » » » » 7 months ago, # ^ |   0 Really what if the length of the cycle is a multiple of D
•  » » » 7 months ago, # ^ |   +28 "I had to do a lot of optimizations to get pass the pretests though, maybe there's a simpler method........" — actually you don't need simpler method, you need harder one :P. At least that's what my friends did in order to omit recursion on 5mlns vertices. It seems you can divide just original graph into SCCs and then do some weird shit with remainders like counting GCDs of all cycles within every SCC etc. Overall complexity is O(nd) anyway, but recursive part is only O(n) and that's supposedly a profit xd.
•  » » » 7 months ago, # ^ |   +47 I tried some optimizations to PP but I got FST:( I think both the time limit and the memory limit are too tight.
•  » » » » 7 months ago, # ^ |   +4 my simple O(n*d^2) got AC :3
 » 7 months ago, # |   +9 that contest was tough one..
 » 7 months ago, # |   0 can anybody help me in knowing why my solution to div2 d is giving wrong answer on pretest 6. sol link : https://codeforces.com/contest/1138/submission/51026146 Thanks in advance
•  » » 7 months ago, # ^ | ← Rev. 2 →   +4 I also kept getting WA test 6 but then I realized that there is an edge case. Consider the input:00001111101With my original code it would have outputted: 10110100 and it would have only contained 2 instances of t.But you can actually get more than 2 instances of t because the strings can overlap, so the optimal result would be: 10101010 which is actually 3 instances of t.
•  » » » 7 months ago, # ^ |   0 Thanks .. got it now
•  » » » 7 months ago, # ^ |   0 Thanks, now i get why my solution is wrong.
 » 7 months ago, # |   +49 Div1 D is basically Floyd's cycle finding algorithm.
•  » » 7 months ago, # ^ |   +29 Oh, I knew this algorithm. Too bad I wasted the whole contest on C...
•  » » » 7 months ago, # ^ |   0 I also know the algorithm but as i suck at interactive problem, i didn't even bother reading it
•  » » 7 months ago, # ^ |   +47 That's a bold statement. I knew this algo and couldn't solve this problem for more than half an hour.
•  » » » 7 months ago, # ^ |   0 Floyd's algorithm is the first thing that popped up in my mind seeing the problem. I wonder if anyone solved it with a different approach.
•  » » » 7 months ago, # ^ |   +17 That's weird, I see no difference between this algo and problem D xd.
•  » » » » 7 months ago, # ^ |   +6 My bad. I knew the idea about moving two pointers with speeds 1 and 2, usually that's enough for all things like Pollard-rho.
 » 7 months ago, # |   +1 wanted just 2 or 3 secs more. Coded the correct solution for B, going to submit and contest over.
•  » » 7 months ago, # ^ |   0 :(
 » 7 months ago, # |   -11 Please judge my first prepassed solution on Div2D! The difference between my first solution and second solution is just number of comparisons of hash value of intervals.. I got TLE on second :(
 » 7 months ago, # |   0 very nice contest ^_^ thank you all
 » 7 months ago, # |   0 I got WA on test 70 for D :( I knew it was too good to be true.
 » 7 months ago, # |   +50 Why it always have to be so long time after a contest to wait to submit my solution
 » 7 months ago, # |   0 how to solve div2 D?
•  » » 7 months ago, # ^ | ← Rev. 2 →   +1 Maybe : Find first position i in string t such that t[i...n] is equal to some prefix of t i.e equal to t[1...n-i+1]. Then build new substring from that position keeping count of zeroes and ones left. Hashing can be applied.
•  » » 7 months ago, # ^ | ← Rev. 2 →   +1 you can solve it very easily using some help of Z_function algorithm which tells you which idx can be prefix of the same string example:string s="11000110"you can see that at idx 5 will have a prefix to the main string which is 110 (that's what the z_function get) so from here you can deduce that after you made up the first string just concatenate the remaining string starts from idx 3. i hope you understand what i meant to say.
 » 7 months ago, # |   0 I tried to hack one of the solution, I uploaded script (which generates testCase) several times, but all the time, there was Generator compilation error. Could you teach me how to hack using generator scripts?
 » 7 months ago, # |   +39 What's with upsolving?
 » 7 months ago, # |   +69 Hi guys, I hope you enjoyed round!In case you wonder why upsolving is not available yet -- it's intended, since the onsite events haven't finished yet. It will be open in roughly 2-3 hours.About editorials, we will be happy to publish them after we finish with the onsite as well.Thanks!
•  » » 7 months ago, # ^ |   0 Thank you for the great round! I think Div1C is an amazing problem!
•  » » 7 months ago, # ^ |   +1 Will upsolving be available soon?
•  » » 7 months ago, # ^ |   0 Here is the link to results of the onsite event. Could you please post the matching between tasks codenames (bering, krusenstern etc) and their cf positions?
•  » » » 7 months ago, # ^ |   +26 AFAIK:1137A - Skyscrapers -- polo1137B - Camp Schedule -- gagarin1137C - Museums Tour -- dezhnev1137D - Cooperative Game -- cook1137E - Train Car Selection -- magellan
•  » » » » 7 months ago, # ^ |   0 correct
 » 7 months ago, # |   +14 My Solution For Problem E can be hacked by n = 1, m = 3e5. Then we preform 299998 times 3 1000000000 1000000000, and then we perform 2 999999998 (10^9 — 2) and then go 2 1. In this way my solution (and many of solutions that get passed) will get a number exceeding the upper bound of the type long long. I think the test is too weak.
•  » » 7 months ago, # ^ |   +3 This is forbidden, isn't it? Also it's guaranteed that the integers Ai will not grow too high. Formally, it's guaranteed that if we sum the largest addition over all events of the 3-rd type (that is, b + (n - 1)·s, where n is the number of cars at that moment) then the acquired sum would be at most 1018.
•  » » » 7 months ago, # ^ |   +21 Sorry, maybe I don't think my data is forbidden. For example, in your code.~~~~~ pts.push_back({r, -overall_b — overall_s * (r — l)}); ~~~~~ "-overall_b — overall_s * (r — l)" this sentence will lead to a exceeding of long long.( And This is not the real value! It's just a tag.) And I have carefully checked that my data satisfies the conditon mentioned in the statement.^_^
 » 7 months ago, # |   0 Is here any other guy's solution for 2c/1a is O(n^2*log(n)) and got tle? I used treap and the time limit seems too tight for me,LOL My brain is quite strange :\
•  » » 7 months ago, # ^ |   +1 I have used set and binary for each a[i][j] in row i and column j Time complexity :- n*m*(log(n) + log(m))
•  » » 7 months ago, # ^ | ← Rev. 3 →   0 Yeah, me too. I passed pretest 8 and failed on the same during main tests.I passed pretests with 1996 ms, after using a back_inserter() :p
•  » » » 7 months ago, # ^ |   +1 I passed test8 with 1949ms，LOL
•  » » » » 7 months ago, # ^ |   0 https://codeforces.com/contest/1138/submission/51021650https://codeforces.com/contest/1138/submission/51062541Same TLE solution gets AC :(Why god Why :(
 » 7 months ago, # |   +8 What is test 70 on Div2D/Div1B?
•  » » 7 months ago, # ^ |   0 Same problem :(
•  » » 7 months ago, # ^ |   0 I think it counter some common hash mod, example 10^9+7
•  » » » 7 months ago, # ^ |   0 Well that's sad.
•  » » 7 months ago, # ^ |   +6 Well I used KMP but also failed on this test 51057303. Anybody has an idea?
•  » » » 7 months ago, # ^ |   +5 I think there's a mistake with your program. For example 1001100001111110001000101100111100101001 01001 Your Answer is 0100101001010010100101001010010011111111 But this is not the optimal solution. （During the contest I want to hack it but it's too hard to construct a set of data... XD
•  » » » » 7 months ago, # ^ |   +6 I found a mistake in my KMP and fixed it. Thx!!
 » 7 months ago, # |   +3 -100 rating hmm nice number that made forget how terrible I did
 » 7 months ago, # | ← Rev. 2 →   +4 The contest has ended and it shows Final standings but I am unable to make any submissions. Is it a bug or am I missing something here? It says you need to be registered for the contest. Edit1: I believe I am not the only one who might have missed kun's comment. For those who have gone ahead to downvote, it would be helpful if you could mention the reason for the same.
•  » » 7 months ago, # ^ |   +10 From kun's comment above"In case you wonder why upsolving is not available yet -- it's intended, since the onsite events haven't finished yet. It will be open in roughly 2-3 hours.About editorials, we will be happy to publish them after we finish with the onsite as well."
•  » » » 7 months ago, # ^ |   +3 Thanks a lot for the clarification.
 » 7 months ago, # | ← Rev. 2 →   0 when it will be available to submit a solution?!!
•  » » 7 months ago, # ^ |   -6 It will probably take a couple more hours since the onsite event hasn't ended yet as kun has mentioned above.
 » 7 months ago, # |   0 Tricky Contest##!!##
 » 7 months ago, # | ← Rev. 3 →   -12
 » 7 months ago, # |   0 How can I submit my code after the contest? It says I am not registered for the contest :(
 » 7 months ago, # | ← Rev. 2 →   0 I missed the contest. Is there any way to participate virtually? I see no options there.Edit : Thanks. Got it.
 » 7 months ago, # |   0 i am a newbie need help :Div.2 A Wrong answer on test 28 https://codeforces.com/contest/1138/submission/51012137 not able to find whats wrong
 » 7 months ago, # |   +26
•  » » 7 months ago, # ^ |   +19
 » 7 months ago, # |   +1 Hello, What is the souliton of div1 C, div2 E?
 » 7 months ago, # |   0 Does anybody know how to get/copy a test case that is finished with the ellipsis "..."?
•  » » 7 months ago, # ^ |   0 You really want to debug your code on a test case that is finished with the ellipsis "..."?I think there is now way now.. but you can go through other test cases from a AC solution and get a smaller test case that gives WA for you
 » 7 months ago, # | ← Rev. 3 →   0 div2b can anyone plz tell me what's wrong with my 51023192 . the basic idea is:for 1st performance i iterate over all possible clowns (clowns+both_skilled).all the other both_skilled goes to 2nd performance. then i take some acro in the 2nd to make it equal . then rest of the acro goes in 1st performance. and rest of the clowns go the 2nd. and fill others with no skill actors. if all verifies i take that number of clown and print
•  » » 7 months ago, # ^ |   0 try this test: 6 111000 111110
•  » » » 7 months ago, # ^ |   0 oh i got it.... thanx man... how silly can i be......? instead of storing how many left.. i stored how many i used
 » 7 months ago, # |   0 How to solve div2D / div1B?
 » 7 months ago, # |   +35 Ahhhh...Finally that's my best rating change (+318) ever...Here is my personal log on the contest: 0min Start. Don't know whether to participate. 15 mins. Read C,D,E. Thinking on C and fail. 25 mins. Come up with the idea of E. Decide to participate and start to write B. 34 mins. PP on B, reading A. 51 mins. PP on A, start doing E. When doing E, I basically debugged for around 20 mins just because I made the order between the slope and the intercept wrong when I read the b and s in the task (i.e. read in the order s b instead of b s). 98 mins. PP on E, trying to do C and D. The ten friends in D is really misleading. Finally when I figured out that 3 of them would be enough, it is already 145 mins after the start. In a rush I finished the last piece of code (and made it wrong for the first time) and submitted on 148 min. PP. Before the contest I wanted to get around +200 to get myself a yellow, but the result is really good for me. Thank you all for the fun and exciting round!
 » 7 months ago, # |   0 How to solve D1C/D2E?
 » 7 months ago, # |   +23 What is test 73 for div1C？It looks like many people failed on it (including me)
 » 7 months ago, # |   -8 _kun_, I found some accepted codes of F is quiet similar, why no skip? 51026411 51023578 51025400 I don’t believe that there is such a coincidence.
 » 7 months ago, # |   0 Why I get RE on test 8 for div2 problem B?? https://codeforces.com/contest/1138/submission/51062872
 » 7 months ago, # | ← Rev. 2 →   +4 https://codeforces.com/contest/1138/submission/51062541https://codeforces.com/contest/1138/submission/51021650are exactly the same for the problem 1138C, yet I got a TLE during the contest.Any chances for getting it rejudged?
•  » » 7 months ago, # ^ |   +12 If you get AC during a contest and TLE in upsolving with the same code, do you want a rejudge too?I think CF already runs a solution a second time if it gets TLE.
•  » » » 7 months ago, # ^ |   +1 Never happened with me before, just asking :p
 » 7 months ago, # |   +13 so, where is the editorial? it's about two o'clock(UTC+8).
 » 7 months ago, # |   +6 Now that's a first...
 » 7 months ago, # | ← Rev. 2 →   0 I got Accepted in 1138B - Circus in Div. 2 with Brute force on a, b, c, d (which are the numbers of different types of artists).I just want to know how to prove the time complexity of this algorithm?My submission is 51069702.Thanks for everyone. :)
•  » » 7 months ago, # ^ |   +3 The if condition in your second nested for loop is a bit unintuitive, but apparently squeezing the search space considerably so that you solution passes. Also you don't need the 4th for loop (over cnt[2]), you can simply assign the value of c using n, a, b and d
•  » » » 7 months ago, # ^ |   0 I have been understood your reply.So I can easily prove that the time complexity of my solution is O(n2).Thank you, sincerely. :)
 » 7 months ago, # | ← Rev. 2 →   0 My O((N + M) * d) solution for Div2 E. / Div1 C. times out on test case 18. Could anyone tell me what is causing this? https://codeforces.com/contest/1137/submission/51080307Edit: TLE resolved by making the DP iterative.
 » 7 months ago, # | ← Rev. 2 →   +10 In question 1.C I got RE The main problem is void bfs(int x,int y){ if(vi[x][y])return; vi[x][y]=1; V.push_back(mp(x,y)); for(int l=e1.son[x];l;l=e1.nextt[l])if(tong[e1.ed[l]]==tong[x])bfs(e1.ed[l],(y+1)%d); } // bfs is actually dfs If you change the vector to an array, you can get ACIn fact, the dfs depth of the program can reach 5000000Why is that?Specific can see
 » 7 months ago, # |   0 The codes for B and C of these two users are almost identical, even the names of all variables in the two codes are identical.
 » 7 months ago, # |   0 ohhh thats so cute of you to congratulate me, you didn't have to, <:)
•  » » 7 months ago, # ^ |   0 I don't think it is a cute act to report cheating. I think everyone wants the game to be fair, so I don't think it is unnecessary to report cheating