### djm03178's blog

By djm03178, history, 8 months ago,

안녕하세요, 코드포스! (Hello, Codeforces!)

I'm glad to invite you to Codeforces Round #620 (Div. 2). The contest will start at Feb/15/2020 16:05 (Moscow time), and it is rated for all participants with ratings under 2100.

You will be given 6 problems and one of the problems has 2 subtasks. The contest duration is 2 hours. The score distribution will be announced later.

All problems are prepared by me, with huge help from the testers with developing great solutions.

I'll be on the community Discord server after the contest to share my thoughts and get feedback about the problems.

Thanks to 79brue, molamola., FlowerOfSorrow, evenharder, cs71107, Justice_Hui, rkm0959, chpark1111, imeimi, alswhp, gaelim, jh05013 (Good tester), yuto0518, N_jara, aryanc403, SnowGoose, --Someone--, surung9898, and ko_osaga for testing the round. I would also like to thank 300iq for round coordination, and MikeMirzayanov for the great Codeforces and Polygon system.

Hope you enjoy the problems!

UPD: The scoring distribution is 500 — 1000 — 1500 — 1750 — 2000 — (2000 + 1000)

UPD2: The contest is finished! Thanks so much for your participation! The editorial is here.

UPD3: Congratulations to the winners!

Div. 2

1: ltst

2: COVID-19

3: cosplay

Unofficial Div. 1

1: wucstdio

2: ksun48

3: jiangly

4: uwi

5: teapotd

• +530

 » 8 months ago, # |   0 A Korean round after a long time.
 » 8 months ago, # | ← Rev. 2 →   +40 Wow! Another Korean Round! I hope you enjoy this round. I am a tester of this round, and I think you would enjoy! Good luck and have fun.
•  » » 8 months ago, # ^ |   +16 Last round made me a pupil because I believed in a similar statement.
 » 8 months ago, # |   +23 I don't think jh05013 is a real newbie.If you see in his first two contests he solved 4 problems and then i think he just didn't care about his profile maybe because he likes being a tester more , so he just intentionally solved 0 problems.And no offence jh05013 but you are just 3 points of rating away,breaking the world record of the most newbie.
•  » » 8 months ago, # ^ |   +8 he said in the linked thing that contests were too stressful for him (he was 1700+). Now he just don't care to mess up :)
•  » » » 8 months ago, # ^ |   +5 Moreover, in this link, he said he is willing to inspect contests(though these are other site contest), and said to call him a tester if someone wants to. Based on the positive response people have to this article I can conclude he is a good tester.
 » 8 months ago, # | ← Rev. 2 →   +28 Finally a newbie Tester this time... So all colors tested this round...sweet
•  » » 8 months ago, # ^ |   -9 I hope C will not be a disaster this time.
•  » » 8 months ago, # ^ |   +9 newbie with peak rank 1708
•  » » 5 months ago, # ^ |   0 He's not a newbie at all.. https://www.acmicpc.net/user/jh05013
 » 8 months ago, # |   +5 우왕!
•  » » 8 months ago, # ^ | ← Rev. 4 →   -52 .
 » 8 months ago, # |   +34 colorful testers
 » 8 months ago, # |   +5 Fan E AE YO
 » 8 months ago, # | ← Rev. 2 →   0 :v Testers in every ranks !
 » 8 months ago, # | ← Rev. 2 →   -46 G
•  » » 8 months ago, # ^ |   -6 Alright the time will be changed accordingly as cf revolves around your schedule :p (not rlly)
 » 8 months ago, # |   0 Editorials ?????
•  » » 8 months ago, # ^ |   +123
•  » » » 8 months ago, # ^ |   +21 Ohh!!! I am sorry man, I was looking for Round 619 Div2 editorials and ended up posting my comment here. I just realized this.
 » 8 months ago, # | ← Rev. 2 →   -10 [Deleted]
 » 8 months ago, # |   -8 Hope B will be clear this time. Past 2 contests Test Cases for B were very hard.
•  » » 8 months ago, # ^ |   -6 Allways read B before submitting A ;)
 » 8 months ago, # |   0 OwO，well...Korea round is my nightmare,hope pass C
 » 8 months ago, # |   +6 As one of the lower ranked testers, I would highly recommend participation in this round. These are good problems, there is something for every skill level here!
 » 8 months ago, # |   0 I wish positive rating for every participant :)
•  » » 8 months ago, # ^ |   +5 We all wish that but this is not possible.
•  » » 8 months ago, # ^ |   +2 The total rating decreases after every contest, otherwise, ratings will become higher and higher because new users will join Codeforces with the initial 1500 rating points.
 » 8 months ago, # |   -26 Round with subtask
 » 8 months ago, # |   +13 팬이에요! :fan:
•  » » 8 months ago, # ^ |   +1 Is Codeforces started to support the Korean language? Cool.
 » 8 months ago, # |   +4 Can someone tell me what does one of the problems has 2 subtasks means? thanks in advance.
•  » » 8 months ago, # ^ |   +13 I'm not quite sure, but it may be an easy version and a hard version of the same problem. Like C1 & C2 for example.
•  » » 8 months ago, # ^ |   +20 One of the problems has an easy version and a hard version. You'll know which problem has subtasks after the contest starts.
 » 8 months ago, # |   -27 expecting implementation problems in both A and B.
 » 8 months ago, # |   -10 I hope the problem statements are short and clear.
 » 8 months ago, # |   +30 Want to be Pupil today.Wish me good luck
 » 8 months ago, # | ← Rev. 2 →   0 I wonder what is jh05013's real rating.Because when he became blue.I can only solve div.2B problemsMaybe he have a real rating of Grandmaster or higher :>
 » 8 months ago, # |   +9 I found a really interesting thing that jh05013 and I have both the lowest rating -43 and after that, our ratings both increase 3.
 » 8 months ago, # |   0 Hope contest will be interesting like previous one
 » 8 months ago, # | ← Rev. 2 →   +11 How to solve E?Edited : Thank you to all who replied. Because I got TLE on pretest 14 during the contest, I'll try again using the faster LCA algorithm.
•  » » 8 months ago, # ^ |   +7 Hint: The added edge is there for parity reasons.
•  » » » 8 months ago, # ^ |   0 I know that, but I failed to optimize the running time.
•  » » » 8 months ago, # ^ |   0 Do I need to know "LCA"?
•  » » » » 8 months ago, # ^ |   0 Yes.
•  » » » » » 8 months ago, # ^ |   +11 In fact,I have never solved any problem about "LCA".I need to learn more!
•  » » » » » » 8 months ago, # ^ |   0 That was the reason I got when I said E is a standard problem. 300iq : "We thought it is not so standard for div2 participants."
•  » » » » » » 8 months ago, # ^ |   -8 wai- how are you even cm?
•  » » » 8 months ago, # ^ |   0 I know parity reasons. but I don't know distance between two node is long than k or not without time limit exceeded.
•  » » » » 8 months ago, # ^ |   +10 With LCA you can find the distance between two nodes in a tree in $O(1)$ or $O(\log n)$ time (depending on which LCA algorithm you use).
•  » » » » 8 months ago, # ^ |   0 I think you need learn "LCA".
•  » » » » » 8 months ago, # ^ |   0 Thank you, I catch a keyword. I'll study LCA algorithm.
•  » » » » » » 8 months ago, # ^ |   0 I didn't solve this problem as well,because I didn't know how to know the distance between any two nodes quickly.QwQ
•  » » 8 months ago, # ^ |   +12 only three possible ways l = a -> x -> y -> b l = a -> y -> x -> b l = a -> bif l<=k and l%2==k%2 then we have a solution
•  » » » 8 months ago, # ^ |   0 Did the same but didn't work :(
•  » » » 8 months ago, # ^ | ← Rev. 2 →   0 I do not get it how to find the shortest possible path after adding x,y, we need that to check against k. Somebody explain?Edit: Or is it expected to do a BFS to find it? That would be to slow.
•  » » » » 8 months ago, # ^ |   0 You need to make use of precomputing depths, and LCA ( Least Common Ancestor ) of two nodes. Read more here.
•  » » » » » 8 months ago, # ^ | ← Rev. 2 →   0 The LCA does not help if the path after adding the new edge x,y is shorter than the one through the LCA.Edit: After reading the other answer below I understand. We simply use LCA again to find path length from a to x and y etc. Thanks for explanation.
•  » » » » » » 8 months ago, # ^ |   +2 Read my comment below. After adding the edge the shortest path will have to be one of the three alternatives. ( It can be proven ).
•  » » 8 months ago, # ^ |   +5 The path between two vertices in the query may either go through the added edge or not. Analyze these cases individually, finding path lengths in O(1) using whatever fast LCA algorithm you prefer. Then if the difference between the length of the path obtained in some of these ways and the desired length if divisible by 2, answer is yes, otherwise no.
•  » » 8 months ago, # ^ | ← Rev. 2 →   +14 Root the tree at an arbitrary vertex. Precompute depths of each node to give distances between two nodes in $O(log(N))$ time using LCA.When adding a new edge $(x,y)$, there are now three possible paths ( without going back and forth ), which are original path between $(a,b)$ $(a,x), (x,y), (y,b)$ $(a,y), (y,x), (x,b)$ Now, if any of these paths can reach $b$ from $a$ in less than or equal to $k$ steps and has same parity as $k$, then answer is YES.
•  » » 8 months ago, # ^ |   0 First we do not consider added edge. We can 'hang out' instead of actually making meaningful move as much as we need — which is, if we can arrive $b$ at $t$, we can hang out some even number of steps loafing back and forth. Then we consider new edge. Since new edge form a cycle, it opens new possibility — by loafing around in cycle. If cycle length is $l$, we can arrive at $p + a\times l + 2b$for any arbitrary nonnegative integer $a, b$, where $p$ is shortest time we can arrive at $b$ using the added edge. (If we are not using the new edge, we can't hang out on the cycle).All we need is careful casework (there aren't many) and computing distance in trees using LCA or some other fast methods.
 » 8 months ago, # |   0 Am I the only one who solved A with binary search instead of much more obvious 1 liner solution?
•  » » 8 months ago, # ^ |   0 If there is the point to which we get after $k$ steps from both $x$ and $y$ is$x + k \cdot a = y - k \cdot b$ $k \cdot a + k \cdot b = y - x$ $k\cdot (a+b) = y -x$ $k = \frac{y-x}{a+b}$So, if $(y-x)\%(a+b)=0$then answer is $k$, in other case the answer is $-1$.
•  » » » 8 months ago, # ^ |   0 I realised this simple solution when I revisited problem A for locking it, after solving up to problem D.
•  » » » 8 months ago, # ^ |   0 this is owsam explanation but I used binary_search here
•  » » 8 months ago, # ^ | ← Rev. 2 →   0 me too, was wondering how others solved it so fast
•  » » 8 months ago, # ^ |   0 I used binary search too, and needed the editorial to make me think of manipulating the equation :)
•  » » 8 months ago, # ^ |   0 You are not alone, binary search was the first idea I thought of.
 » 8 months ago, # |   +2 How to solve C?
•  » » 8 months ago, # ^ | ← Rev. 2 →   +2 After each customer comes in, you have an effective range of temperature, let it be (x, y). For the next customer find the intersection of (x — t, y + t) (where t is difference between entry times) and his temperature range. That is your new effective range. Initial range is (m, m). If all the intersections are non-empty you can satisfy, otherwise no.
•  » » » 8 months ago, # ^ |   0 Thank you, it certainly makes sense to me now
•  » » » 8 months ago, # ^ |   +1 I did the same thing but I got WA in pretest 3
•  » » » » 8 months ago, # ^ |   +9 I got the same result in the beginning. Apparently, I was breaking out of the for loop without taking all of the input.
•  » » » » » 8 months ago, # ^ |   0 yea one need to be careful of that
•  » » » » » 8 months ago, # ^ |   +5 I got 1 WA for same reason. By coincedence it passes the example input QAQ
•  » » » » » 8 months ago, # ^ |   0 help a lot
•  » » 8 months ago, # ^ |   0 Group all customers attending at a given time t. For each group check if there is an overlapping temperature range and store that. For instance if the ranges are [(1, 4), (2, 5)], the overlapping range is (2, 4). If it's not possible to form an overlapping range at any t, then it's not possible Assuming each t has a range, check if it's possible to move from range at ti to range at ti+1. Also update the range of temperatures possible at each step. If possible range at step i is (lo, hi), Then possible range at step i + 1 is (lo - (ti+1 - ti), hi + (ti + 1 - ti)) Just check if that is acceptable for all customers at ti+1 and update lo and hi. (Not sure if this step can be optimised further but it passes the problem limits) My submission 71152069
•  » » 8 months ago, # ^ | ← Rev. 2 →   +5 I have a solution that is easier to implement in my opinion.Loop through all pairs of customers. If it is impossible to reach the second Customer's range from the 1st Customer's range in the time difference between them, then the answer is impossible.O(N^2) solution.
•  » » » 8 months ago, # ^ |   0 I think your solution will fail systest
•  » » » » 8 months ago, # ^ | ← Rev. 2 →   +8 It already passed 71138487
•  » » » » » 8 months ago, # ^ |   +5 congratulations on becoming CM. Now I see why your solution passed.
•  » » » » » » 8 months ago, # ^ |   0 Thanks!
 » 8 months ago, # |   +9 How to solve C and D guys ?
•  » » 8 months ago, # ^ |   +1 For CLet's say that we have minimal and maximal temperatures with which we can get to the next consumer, and if the intersection of our range and range (l,r) is not empty, then it's okay, now we just update our range — basically it would be equal to intersection of ours and (l, r).My submission: 71146715
•  » » » 8 months ago, # ^ |   0 Thanks, I only know how to solve case (x < l) and (x > h) but not (l <= x <= h) :<
•  » » » » 8 months ago, # ^ |   0 Ahh, so you needed to have a lower range and upper range... I tried recursion which in one case i try to reach the lowest possible temperature, in other the highest, tho i couldn't implement it fully :D
•  » » » 8 months ago, # ^ |   0 good explanation thanks Mr.Hakimov
•  » » 8 months ago, # ^ |   0 For DThe main idea here is that for minimum we should build our array in such a way that bigger numbers have lower indexes and for maximum bigger numbers should have bigger indexes.You can chek out my submission: 71159214
•  » » » 8 months ago, # ^ |   0 Thanks. But can I solve D problem using prefix array & suffix array ?
•  » » » » 8 months ago, # ^ |   0 That's a good question, but I don't think that there is a necessity in them :)
•  » » » » » 8 months ago, # ^ |   0 If I use prefix-suffix array, what should I approach
 » 8 months ago, # |   +16 how to solve D?
•  » » 8 months ago, # ^ |   0 For Min: starting from the first '<', start at n and go down but if there are <<<< or something sort that subarray then for the rest just go down by 1 each time so say for the 2nd sample, my answer would be 5 4 3 7 2 1 6Max: for max it's the same thing but all the numbers after a < are going up so 5 4 3 6 2 1 7
 » 8 months ago, # |   +2 Thanks for the contest, have a good day problem setters <3
 » 8 months ago, # |   0 In Problem B of DIV2. the problem statement mentioned that the string can be "REORDERED" and not "REVERSED" but my code was failing the first testcase here : https://codeforces.com/contest/1304/submission/71145055
•  » » 8 months ago, # ^ |   +1 No, you can't reorder a string. You can reorder the list of strings.
•  » » » 8 months ago, # ^ |   0 Ohh Okay. But this got me very confused and thus wasted a lot of my time.
•  » » 8 months ago, # ^ |   0 strings can be reordered not a particular string !
•  » » 8 months ago, # ^ |   0 I can't see your code, but "Strings can be reordered" means order of concatenation can be changed, not the strings themselves
•  » » 8 months ago, # ^ |   0 The list of strings can be reordered, not the strings themselfes.
•  » » 8 months ago, # ^ |   0 My AC solution outputs the test case: 2 2 aa aa -> 2 aa. When I think it should be aaaa, 4. Can somebody explain me why !?
•  » » » 8 months ago, # ^ |   0 It is an invalid input because all strings must be distinct.
 » 8 months ago, # | ← Rev. 2 →   0 Can someone please tell me why this code for C is giving rte. The only place where an exception can be thrown is the assert in which case the test cases are wrong. https://codeforces.com/contest/1304/submission/71155599
•  » » 8 months ago, # ^ |   0 Perhaps it has to do with your usage of the word "time"? I think it's a reserved keyword that can still do arithmetic with integers. You're right, the code itself doesn't seem like it can segfault as far as I can see.
•  » » » 8 months ago, # ^ |   0 I had submitted the same code without the assert line. That gave wa.
•  » » » » 8 months ago, # ^ |   0 That doesn't necessarily imply much; undefined behavior is still within your set of possibilities. In fact, I'm much more inclined to think that you have UB somewhere; this would probably cause a segfault sometimes and a WA at others.
•  » » » » » 8 months ago, # ^ |   0 The thing is that I have been getting RTE only when I have included assert in the code. I have submitted the same code without assert thrice (introducing one useless variable each time so that it allows me to submit) and got WA in all those.
•  » » » » » » 8 months ago, # ^ |   +9 I've gotten several questions regarding this.The problem is that you're "returning" the function while you haven't gotten the full test case yet. Some people used 'break' inside a loop. These codes generally got incorrect on pretest 3.
•  » » » » » » » 8 months ago, # ^ |   +5 Yes that's the mistake. Thanks for pointing out and sorry for wasting your time.
•  » » 8 months ago, # ^ |   0 I got similar Runtime error in Problem B today. It was resolved by removing #define int long long. I couldn't figure out Why it happened today, I haven't faced any problem due to this statement earlier.My Submission link: Submission
•  » » 8 months ago, # ^ |   0 You are returning from function, "solveTestCase", before taking all inputs. Instead return only at the end of the function.
•  » » » 8 months ago, # ^ |   0 Okay yes. That is the error. Thanks for pointing out!
 » 8 months ago, # |   +70 Every time........!
•  » » 8 months ago, # ^ |   +3 I feel exactly the same. :(
 » 8 months ago, # |   0 Thanks for the round, hope pretests were good enough.... I wish everyone to increase their rating ;)
 » 8 months ago, # |   0 Oh,just five minutes after the contest over my solution passed all the examples.:( The code for the round are a little bit long. I think a longer time will be better.:)
 » 8 months ago, # |   +16 Why does codeforces skip main test and don't take the best submission? I missed my chance of becoming Master today.
 » 8 months ago, # |   0 I don't understand what is wrong in my submission, the answer is printed but still it shows run time error. Here is my submission 71154644
•  » » 8 months ago, # ^ |   0 if(second.size()==0) It will give run time error .
•  » » » 8 months ago, # ^ |   0 Could you explain why?
•  » » » » 8 months ago, # ^ |   0 Because second.size does not returns an int value therefore second.size() -1 will not be -1.
•  » » » » » 8 months ago, # ^ |   0 Thanks ..
 » 8 months ago, # |   0 here i come #808080
 » 8 months ago, # |   0 really sad, failed B on test 13.
 » 8 months ago, # |   0 It was such a good contest for the beginners. As the problems were not so hard as before :) But I think it should be harder, especially the Problem F.
•  » » 8 months ago, # ^ |   0 If contest was 4 hours instead 2 I was solve all :-(
 » 8 months ago, # |   0 My color is going to change. I love these questions!!!
 » 8 months ago, # |   0 Thank you for strong pretests!
 » 8 months ago, # |   0 Question B : Why there is run time error coming in https://codeforces.com/contest/1304/submission/71161367 this code can anyone tell me?
•  » » 8 months ago, # ^ |   0 because of this loop for(i=v.size()-1;i>=0;i--). v.size() does not return int value.
 » 8 months ago, # |   0 https://codeforces.com/contest/1304/submission/71145443 : what's wrong with this code
•  » » 8 months ago, # ^ |   +9 The problem is multi-case. which means you can't puts("NO") then simply return, or as the input continues, in fact your program will read the wrong data.
•  » » » 8 months ago, # ^ |   0 oh! thanks...
 » 8 months ago, # | ← Rev. 4 →   0 What is the mistake in this code, I am getting wa on prestest 8
•  » » 8 months ago, # ^ |   0 If you erase elements in a set while iterating through it, especially your current pointer, you might end up skipping a few elements. This is shown when you run your code on the following case: 4 2 ab cd ba dc A different approach is to scrap the set entirely and instead use an array of strings, with boolean markers that say if you've used that string already (example, with the mk array).
•  » » » 8 months ago, # ^ |   0 Thanks a lot man!But why does it skips a few elements?
•  » » » » 8 months ago, # ^ |   +3 I didn't realize that you called a vector s, but it functions the same as a set in this context. My bad.Imagine your vector like this: ab <- (pointer) cd ba dc Now you find ba to be a match with ab, so you erase them both. Where does the pointer go? It can only advance to cd: cd <- dc Now you increment the pointer, and it ends up at: cd dc <- Since you only check ahead of your current iterator for matches, you don't find anything else and terminate. There's probably a topic on StackOverflow addressing this issue, but the basic premise is to only increment when you don't erase.
•  » » » » » 8 months ago, # ^ |   0 Thanks for the wonderful explanation man. Fully understood it! Thanks once again for your time and have a nice day!
 » 8 months ago, # |   0 I believe test cases for D are a bit weak?I changed my code for D a bit during contest as it had 1 mistake, but after the contest, it still passed....
 » 8 months ago, # |   0 71166353 works on pretest 4 on my machine, and on ideone link but failed during contest and also on custom invocation. MikeMirzayanov djm03178
•  » » 8 months ago, # ^ |   0 71177225 unordered_map -> map => WA -> AC
•  » » » 8 months ago, # ^ | ← Rev. 2 →   0 the same code gives correct output on my machine and another ide and on codeforces if used with c++17 but fails with c++14, i want to understand why is that the case, exactly what is not working in this case.
•  » » » » 8 months ago, # ^ |   0 have you figured it out?
•  » » » » » 8 months ago, # ^ |   0 no, changing the order of input strings makes the test case pass in custom invocation on cf, when i tried to debug in cf custom invocation it was weird, somehow the entries in my unordered_map were getting corrupted during the execution. AK18
•  » » » » » 8 months ago, # ^ |   0 AK18 however the logic is same, unordered_map -> map should make no difference really, to me it seems like deep magic
•  » » » » » » 8 months ago, # ^ |   0 I just changed unordered_map -> map and used C++14, it's AC. I guess it has something to do with the unordered map which I am not aware of. 71278944
•  » » » » » » » 8 months ago, # ^ |   +3 The problem is int count_r = freq[r];. It causes the unordered_map to insert r if there was no such element. By result, rehashing can occur, and therefore all iterators are invalidated, affecting the loop for(auto x: freq) in a bad way.In contrast, using map::operator[] doesn't affect iterators at all. Check these two documents:
•  » » » » » » » » 8 months ago, # ^ |   0 Thanks :)
 » 8 months ago, # |   0 My solution of B is failing in this test case but somehow it managed to pass system testing — 3 3 tab bat tab
•  » » 8 months ago, # ^ |   0 All strings are guaranteed to be distinct, so your test case isn't valid.
•  » » » 8 months ago, # ^ |   0 sorry
 » 8 months ago, # |   0 I think it is good blog when i saw in my life
 » 8 months ago, # |   0 where i am wrong? https://codeforces.com/contest/1304/submission/71174871 problem Ci am iterating in reverse, finding the largest intersection possible so that both current and previous customer are satisfied with temperature
 » 8 months ago, # | ← Rev. 2 →   +7 Not sure if I should be posting this here, but:I just got a message saying that my solution for problem E coincides with that of some other participants. This is likely because I used the CP Algorithms implementation for LCA which you can find here: https://cp-algorithms.com/graph/lca.htmlAlthough I added a few additional methods in my source code, a big chunk of my solution was for the LCA structure. So I guess that could've set off the response. I hope this clears things up.If you need any more information, please let me know. MikeMirzayanov
 » 8 months ago, # | ← Rev. 4 →   0 Anyone can help me debug it? here I was trying find max and min possible temperature at every next moment when customer appear.
•  » » 8 months ago, # ^ |   0 Nevermind, I managed to repair it thanks to one of solutions, so... -->here It seems that I like to complicate simple things. That things happen when I try to rush too much, and type faster than know solution.
 » 8 months ago, # | ← Rev. 2 →   +9 I am not sure whether I should comment here . but i just got a warning about coinciding my code with another user.Since I am new here , I dint know about the codes copying from ideone . I was using IDEONE in default setting. My code is https://codeforces.com/contest/1304/submission/71137281. And the guy who copied my code is https://codeforces.com/profile/8bit_thug I request you not to do this. this kills contest spirit. And yeah Since He submmitted code after 3 minutes when I submitted hence it is cleared that he copied my code. Moreover all his submissions are skipped. Do I need to provide more information? MikeMirzayanov
 » 8 months ago, # |   +2 My solutions for this contest were skipped most likely because I used the implementation of LCA from here which is probably where some other participants picked the code up from. djm03178 can you look into this?
•  » » 8 months ago, # ^ |   +8 Sorry, there's nothing that can be done from my side.
•  » » » 8 months ago, # ^ |   +1 Alright. MikeMirzayanov
 » 8 months ago, # |   0 Мое решение 71159863 по задаче 1304E совпадает с решением другого пользователя, так как видимо мы использовали один и тот же источник, а именно https://e-maxx.ru/algo/lca.
 » 8 months ago, # | ← Rev. 2 →   +1 I got a message from User system regarding code similarity about the E problem (71164831). I have used the code for lowest common ancestor from this site (same code published in the site mentioned by other affected users) which was last updated on 15th June 2018 (here) which is conclusive evidence of this being published well before the contest.
 » 8 months ago, # |   +9 I hope this is the right place to put this, otherwise, please tell me where I should write this. I received the following message: Attention! Your solution 71159069 for the problem 1304E significantly coincides with solutions ksun48/71134293, hoke_t/71152328, Venia/71156816, hanga97/71159069. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.com/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked. For the solution of problem E, I used the RMQ (range minimum query) and LCA (lowest common ancestor) implementations from https://github.com/kth-competitive-programming/kactl/This code was online long before the start of the round, so I hope, this issue can be resolved.Thanks for the round btw. I enjoyed it.
 » 8 months ago, # |   +2 Can someone answer why the compiler of Codefoces gives run time error if i have not type casted size of a vector whereas most of the other compilers don't give that error. In this contest only i got stuck in problem B due to this error.
•  » » 8 months ago, # ^ |   0 Me too
•  » » 8 months ago, # ^ |   +3 the .size() function returns an unsigned integer, so when you try to do.size() — 1 when the size is 0, it overflows and causes runtime error.
•  » » » 8 months ago, # ^ |   0 Got that...but when i did this for(long long i=a.size()-1;i>=0;i--), it gave me run time error but for this for(int i=a.size()-1;i>=0;i--) it did not. Can you tell me why this happened? And thanks in advance :)
•  » » » » 8 months ago, # ^ | ← Rev. 4 →   0 Because 0ull — 1 is much larger than 0u — 1?
 » 8 months ago, # | ← Rev. 2 →   +1 Can someone please explain how I am getting a different output for E on my local compiler than the codeforces judge.71178404I am the getting the expected output on my machine. I believe the logic is correct. https://ideone.com/LfR13i Expected output with same input
 » 8 months ago, # |   0 Nice problemset!
 » 8 months ago, # |   +6 Hello MikeMirzayanov, I have received a message about being disqualified from the contest, because of plagiarism. I have used the LCA calculation from cp-algorithm. Here is a link to the web archive, as evidence, that the code has been published before the contest. I have not used any online IDE. Kindly look into this, Thanks a lot!
•  » » 8 months ago, # ^ | ← Rev. 2 →   +2 Hi MikeMirzayanov, I have received the same email, I have also used the LCA part from cp-algorithmm, same source as animal-liberty and also quite a few others as mentioned in the email. Link to source.
 » 8 months ago, # |   +1 Hey, My solutions were skipped because one of them coincided with solutions of other participants. It was 100% caused because of this implementation of LCA, which I use for a long time. Regarding rules, one can use publicly available implementations posted before the round. MikeMirzayanov can you do something about this?
 » 8 months ago, # | ← Rev. 2 →   +29 Me in this contest:Firstly, solve problem C, and then B-A-D-E-F.After solving all the problems, I looked at the standings, and found rank 2 is only 61 points lower than me, and he has locked all his problems and started hacking.So I locked my ABCDE and started hacking too.When I opened a solution to problem B, I was surprised to find there was a very silly BUG. A code with such silly BUG wouldn't pass the pretests.So I took a look at the statement, only to find that I had misread the problem. I thought I can reverse any strings as well as reorder them.1000 points! If I had not made such a silly mistake, I would probably get on the 1st place, but now I couldn't resubmit because I had locked my problem. So I poured out my sadness to jiangly, who had solved all the problems too and become rank 3 at that time.Here is the chat history:Yes, I misread the problem again. I forgot that all the strings are distinct.So from my story we can conclude that it's very important to read the statement carefully, but if you misread the statement, you still have chance to pass the problem.:)
•  » » 8 months ago, # ^ |   0 Lol same. I also thought I need to check the length of the only palindromic string I will add in the middle and changed my code in the last minute of the contest. And after 5 minutes comes the realization that all the string have the same length. Lost 500 points and went from +45 to -13.
•  » » 8 months ago, # ^ |   0 I just found out that I also misread. Thank you.
 » 8 months ago, # |   0 Problem B would not have been much harder if the restriction on the strings having equal lengths were dropped.
 » 8 months ago, # |   0 can anyone explain why my code is failing on testcase 8 in problem B. LINK to source code :: https://codeforces.com/contest/1304/submission/71215931
•  » » 8 months ago, # ^ | ← Rev. 3 →   0 I don't really know, only fast checked, but do you think is it safe in the last iteration? I'm aware s.begin()+i+1 seems to be higher than s.end()?  vector ::iterator it=find(s.begin()+i+1,s.end(),a); I think it's better iterate to s.size()-1
 » 8 months ago, # |   0 In problem D, you can solve for max LIS and re-use it to find min LIS by manipulating the string, ie. reversing and inversing — replacing $<$ and $>$ with one another. Here is my solution.
 » 8 months ago, # |   +15 Great contest！
 » 8 months ago, # |   0 congratulations to the winners of this round
 » 8 months ago, # |   0 My contest history for this contest is suddenly deleted.Why this happened?
•  » » 8 months ago, # ^ |   +5 Rating changes for the last round are temporarily rolled back. They will be returned soon.
•  » » » 8 months ago, # ^ |   0 Thanks for the information!
 » 8 months ago, # |   0 apology for poor englishwhere were you when top rate diesi was sat at work writin code when telegram ring'top rated is die''no'and you???????
 » 8 months ago, # |   0 hello in solution B try this 2 3 AAA AAA and it will answer you 3 AAA i think it should be 6 AAAAAA anyone can help me with this i can't see in description that say the same string doesn't count
•  » » 8 months ago, # ^ |   0 It says "All strings are distinct."