By awoo, history, 4 years ago, translation,

Hello Codeforces!

On May/21/2018 17:45 (Moscow time) Educational Codeforces Round 44 will start.

Series of Educational Rounds continue being held as Harbour.Space University initiative! You can read the details about the cooperation between Harbour.Space University and Codeforces in the blog post.

This round will be rated for the participants with rating lower than 2100. It will be held on extented ACM ICPC rules. After the end of the contest you will have one day to hack any solution you want. You will have access to copy any solution and test it locally.

You will be given 7 problems and 2 hours to solve them.

Good luck to all participants!

Congratulations to the winners:

Rank Competitor Problems Solved Penalty
1 Benq 6 143
2 crhkr 6 202
3 mjhun 6 210
4 nhho 6 210
5 krijgertje 6 223

Congratulations to the best hackers:

Rank Competitor Hack Count
1 step_by_step 248:-25
2 greencis 31:-6
3 zero-light-some 15
4 Necrozma 12
5 Codefocres 11:-1
703 successful hacks and 490 unsuccessful hacks were made in total!

And finally people who were the first to solve each problem:

Problem Competitor Penalty
A dotorya 0:01
B dotorya 0:03
C dotorya 0:10
D Benq 0:21
E GoodGuy 0:07
F Deemo 0:49
G Marco_L_T 0:44

• +286

 » 4 years ago, # |   +41 Finally, educational round, I miss you!
•  » » 4 years ago, # ^ |   +15 Same, my friend!
•  » » 4 years ago, # ^ |   0 I also miss that :)
 » 4 years ago, # |   +15 I love this round. As, educational, it teach me a lot.
 » 4 years ago, # |   +9 What happened to BledDest? I have not see him in any educational contest for a while.
•  » » 4 years ago, # ^ |   +14 He just got a bit busy with his exams at university. Might be back soon when they are over.
 » 4 years ago, # |   0 What is an educational round? How is it different from a normal one?
•  » » 4 years ago, # ^ | ← Rev. 2 →   +47 It is meant for we to try multiple types of problems, even if they might not be very original. Each problem has not a specific score, but rather is just the solving time that makes your score. This means that, for example, solving A+B+D and solving A+B+C within the same exact time will give the same score, even if D might be more difficult than C. Finally, hacking is not enabled during the contest, but a long (12-24 hours) hacking phase takes place after the contest. After that, system tests are run, as for normal contests.
 » 4 years ago, # |   +33 Please, choose more comfortable As, Bs and Cs in future rounds, so that they're not just silly implementation problems :)
•  » » 4 years ago, # ^ |   +21 The more you avoid it, the more you are unable to solve it later.
•  » » » 4 years ago, # ^ | ← Rev. 2 →   0 Very true and relatable. You don't lose anything by just implementing, if not anything it helps with speed and coming up with elegant implementation.
 » 4 years ago, # |   -25 The third lucky number,It's palindrome number,Double the sum of it's digits equal to any digit of it square,The number which product of it's digits equal to any digit of it square.
 » 4 years ago, # |   -73 What about div.3 ?
•  » » 4 years ago, # ^ |   +9 There is one line in bold in the post, read it again, it answers your question.
• »
»
»
4 years ago, # ^ |
Rev. 5   0

Sometimes even bold is not enough for some people to see. They need bold header.

##### rated for the participants with rating lower than 2100
 » 4 years ago, # |   0 Are the problems easy?I'm new in here.
•  » » 4 years ago, # ^ |   0 The problems of Educational Rounds explore different topics. Yeah, there are difference of difficulty among Educational Rounds Problems. But the scoring is depend on the time you solve those problems. The faster you can solve those problems, the lower your penalty will be.
•  » » » 4 years ago, # ^ |   0 Thanks.
•  » » 4 years ago, # ^ |   0 See the problems of previous educational rounds. Then you can get concepts about how the problems are
•  » » » 4 years ago, # ^ |   0 OK,I will.Thanks.
 » 4 years ago, # | ← Rev. 2 →   0 Thanks all the authors to put the great effort and valuable time for preparing this educational round, these rounds are very helpful for learning.
 » 4 years ago, # |   0 Is education rounds different than the normal rounds? What is special about it? Can someone explain this to me?
 » 4 years ago, # |   0 Can't you delay this contest by two hours awoo
•  » » 4 years ago, # ^ |   +8 You must not a Chinese
•  » » » 4 years ago, # ^ |   +8 agree you
•  » » » » 4 years ago, # ^ |   +40 sorry for my bad england
•  » » » » » 4 years ago, # ^ |   +3 My boyfriend is the only one I can say.
•  » » » » » 4 years ago, # ^ |   -16 *English
 » 4 years ago, # |   0 Are tasks sorted in difficulty order?
•  » » 4 years ago, # ^ |   +13 Usually yes
 » 4 years ago, # |   0 Yeah ! <3
 » 4 years ago, # |   -12 Wish everyone high ratings :D
 » 4 years ago, # |   +16 First educational round rated for purple :)
 » 4 years ago, # |   +36 aaand 10 mins delay :/
•  » » 4 years ago, # ^ |   +7 :( was waiting for it and now have to wait more!!
•  » » » 4 years ago, # ^ |   +4 But the participation has crossed 7000 :)
•  » » » » 4 years ago, # ^ |   0 Yes! I hope their server does not gets down just like the first Div-3 where they had a huge number of participants.
•  » » » » 4 years ago, # ^ |   0 it means slower judging queue :(
•  » » » 4 years ago, # ^ |   +2 thats the sence of Codeforces... You wait... And wait... And then wait more... And finally the round becomes unrated :c
•  » » 4 years ago, # ^ |   +6 someone know why delay 10min ...?
•  » » » 4 years ago, # ^ |   +3 Because the problem statements haven't be translated yet and KAN has to rush it! :D
•  » » » 4 years ago, # ^ |   +46 Someone's girlfriend didn't register
•  » » » 4 years ago, # ^ |   +1 I don't know why, but I was late to get breakfast and now I can participate in the round so I am thankful for it :)
•  » » » » 4 years ago, # ^ |   0 lucky you ^^
 » 4 years ago, # |   0 Rly?
 » 4 years ago, # |   +97 That moment when the round gets delayed and you suddenly have 10 minutes but you don't know what to do with them.
•  » » 4 years ago, # ^ |   0 do what you are doing XD
•  » » » 4 years ago, # ^ |   +34 I KAN't :P
 » 4 years ago, # |   -8 The comment removed because of Codeforces rules violation
 » 4 years ago, # |   +15 What is test case 7 in C?
•  » » 4 years ago, # ^ |   0 Idk, but I changed my solution from int to long long and it worked, maybe you forgot long long?
•  » » » 4 years ago, # ^ |   0 I did take long long , but still failed.
•  » » » 4 years ago, # ^ |   0 i changed int to long long too, but my WA didn't change..
•  » » 4 years ago, # ^ |   +7 Try:3 2 51 3 3 4 6 7Answer is 10
•  » » » 4 years ago, # ^ | ← Rev. 2 →   0 I got the mistake thanks buddy
•  » » » » 4 years ago, # ^ |   0 What was your mistake?
•  » » » » » 4 years ago, # ^ |   +3 I was filling it from top to bottom!
•  » » 4 years ago, # ^ |   0 I ran loop from 0 to n-1 instead of 0 to m-1 and got WA in test 7 once. Check it
 » 4 years ago, # | ← Rev. 2 →   +3 Approach for C? I had thought to take the lowest number as one barrel with the least vol and then take another barrel such that a[i]-a[0]<=l and ai is maximum. Now if we have n-2 numbers between these such that a[0]<=a[j]<=x then we have an answer otherwise 0. Is this approach correct?PS I failed on TC-#7
•  » » 4 years ago, # ^ |   +3 Well, you can't do that. Because solution isn't optimal. What you need to do (I did it in this way, maybe there are easier ways) is find maximum number p such that a[p]-a[0]<=l. Then, from p to what number left, "erase" numbers bigger than a[p] (make them join group where a[p] is last element) so res+=a[p] for every decreasing p that has numbers bigger and not used. (sorry for bad english..) When you finish with the big numbers. Go from i=0 to remaining numbers that you didn't used. And that's it. I hop you at least understand something. Check my submission for more details.
•  » » 4 years ago, # ^ |   0 maybe the number of a【i】will exceed n-1
 » 4 years ago, # |   0 Why is hashing needed in F?
•  » » 4 years ago, # ^ |   0 We can hashes subscripts for each letter within each query range.
 » 4 years ago, # |   0 Hello, can somebody explain the solution for F (Isomorphic Strings)? My guess is some form of hashing, but I could not come up with a way.
•  » » 4 years ago, # ^ |   0 You need segment tree, but I don't know why do we need hashing. Isn't it enough to just check if length of sets is same or not? Appreciate counterexaple
•  » » » 4 years ago, # ^ |   0 for example, aab and abb are not isomorphic.
•  » » » » 4 years ago, # ^ | ← Rev. 3 →   0 f(a)=b and f(b)=a , am I missing something UPD: I am stupid, nevermind
•  » » » » » 4 years ago, # ^ |   0 then f(s[1]) = b != t[1]
•  » » » » » » 4 years ago, # ^ |   0 Yea, i misunderstood statments
•  » » » » » 4 years ago, # ^ |   0 What the problem meant is: If you replace every character in s with f(s[i]) you should get string t. Meaning that "aab" and "abb" are not isomorphic since running s through your function would create string "bba" and not "abb".
•  » » 4 years ago, # ^ |   +10 Your guess is correct. For a given query {x, y, len}, find the first occurrence of each letter which is after position x. Now if this occurrence is after position x + len - 1, we ignore it. Otherwise, let's say the position is x + p, then we know that f(s[x + p]) = s[y + p]. This means that the occurrences of character s[x + p] in s[x, ..., x + len - 1] should be on the same positions as the occurrences of character s[y + p] in s[y, ..., y + len - 1]. Well, to check if these positions are actually the same, we can keep an array c[letter] for each letter where c[letter][i] is 1 if s[i] = letter and 0 otherwise. Then, using polynomial hashing on these c arrays gives us a O(1) comparisons of the occurrences.
 » 4 years ago, # | ← Rev. 2 →   +5 E was such a nice problem.., although was unable to do it during contest!!
•  » » 4 years ago, # ^ |   +16 Nah, it was so standard.
 » 4 years ago, # |   +21 Problem D. — I thought h1 was a typo in h_1 ≤ H: no sand should go over the fence; because of the no one clause, but as reading whole statement and asking to judge, turns out it wasn't ;'(
•  » » 4 years ago, # ^ |   +6 you could have sent question if you weren't sure.
•  » » 4 years ago, # ^ |   +23 Wait, so only the first pillar has to be less than H? The rest can be greater?
•  » » » 4 years ago, # ^ |   +8 Yes. Now you panicked just like me.
•  » » 4 years ago, # ^ |   +8 LMAO, now I know why my solution was wrong
•  » » » 4 years ago, # ^ |   +3 Just found out that. Wasted a lot of time on D and then solved E with huge penalty.
•  » » 4 years ago, # ^ |   +3 I think it isn't clear, but you should check that "h_1" <= H. If there were an example 1,2,1,0(H=1), It would be good.
•  » » 4 years ago, # ^ |   +48 Honestly, I don't really see any problem with this line. The formula says the right thing, the description extends it meaning. I probably could have added it to notes, I agree.Chelslay says the right thing, you should have asked earlier if you thought we made a typo.
•  » » » 4 years ago, # ^ |   0 Oh, I added a couple words now, by the way.
•  » » » 4 years ago, # ^ |   0 Yeah, I also have to admit that I didn't read the statement carefully. What I'm sad is that I asked for it so late. If there were more time, I could solve it. ( since I got AC just before ;) )
 » 4 years ago, # |   +27 for D, first condition that watched me h[i] <= H first time, after get WA on 7, h[1] <= H
•  » » 4 years ago, # ^ |   +11 Oh my god. I didn't even realize that until I see you comment...
 » 4 years ago, # |   +11 ideas:E: Sort, now the boxes can contain consecutive elements so we can dpF: Let's calculate the hash for each character using a segment tree.G: Sum the ranks of all possible teams (i,j,k), then for every edge (u,v) subtract the rank of (u,v,k) for every k. Finally add the rank of (u,v,w) for every triangle (u,v,w) in the graph
•  » » 4 years ago, # ^ |   +5 Read accidentally, got spoiled. :o
•  » » 4 years ago, # ^ |   0 D?
•  » » » 4 years ago, # ^ |   0 Run two binary searches. one for 1,....,K and another one for K + 1, .... LARGEST_VALUE, ... K + 1
•  » » » » 4 years ago, # ^ | ← Rev. 3 →   +3 I currently submitted a solution only by mathematical manipulations, previously I was squaring a number bigger than 1e9.38513673
•  » » » » » 4 years ago, # ^ |   0 Oh, wow. That's a very impressive approach! Thinking final sequence as symmetry first, and removing redundant tail part. I really learned many things from your code. XD
•  » » » » » 4 years ago, # ^ |   0 Hey! Can you explain what you did ?
•  » » » » » » 4 years ago, # ^ |   +3 I firstly calculated the max height I can reach such that I have enough sand bags to come down, then I calculated how many sand bags are left from reaching that height and then coming down to the ground . After that I calculated the length of the plateau by diving the remaining bags with max height and if now there is some remaining bag , I just increase the answer by one because that can be compensated by a dual move of that height when we reach that height while coming down. We can prove that it will always be equal to one of the coming down heights.
•  » » 4 years ago, # ^ |   0 Can you elaborate how to dp in E please?
•  » » » 4 years ago, # ^ |   +3 f[i]=is possible to put in boxes the pencils from i to n?
•  » » 4 years ago, # ^ |   +8 Hash can also be calculated by maintaining a prefix array of hash
 » 4 years ago, # |   +23 is it rated?
 » 4 years ago, # |   +29 E solution... wrong.... so sad.... :( Is it rated...?
 » 4 years ago, # | ← Rev. 2 →   +3 Can someone explain their solution for E? I was thinking about something involving cliques but couldn't figure it out.
•  » » 4 years ago, # ^ |   0 first sort all numbers, now you just need to group consecutive elements, we can use dp to solve this problem. Let dp[i] indicate whether the first i elements can be successfully grouped, dp[i] is transferred by dp[l] | dp[l + 1] | ... | dp[r — 1] | dp[r]. l, r is the interval endpoint that makes dp[i] exactly satisfy condition, As i increases, l increase, r increase, so you can use deque to maintain.
 » 4 years ago, # |   +5 Is finding all triangles in a graph something well known to the community? I managed to find this which works in O(M3 / 2) but this is my first encounter of this algorithm.
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 It is an standard task. There is a simple sqrt-dec algorithm.
•  » » » 4 years ago, # ^ |   0 Can you give me some hint / any tutorial about that algorithm?
•  » » » » 4 years ago, # ^ |   0 If you have time, you can just wait for editorial.
•  » » » » » 4 years ago, # ^ |   +14 I have time, but unfortunately, I lack patience.
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   +5 I came up with this algorithm:Let's call a vertex heavy if it has degree >= sqrt(M).Let's call a triangle heavy if it contains at least one heavy vertex. We can count the light triangles as follows: Iterate over all edges (u,v) were both u and v are light. Now for every light vertex w adjacent to u, check if (w,v) exists in the graph. For heavy triangles, let's iterate over every heavy vertex u, and mark its adjacent vertices as visited. Now for every edge of the graph check if it has both of its endpoints visited.
•  » » » » » 4 years ago, # ^ |   0 wow ._.
 » 4 years ago, # |   0 How to solve C ? I got WA on test 8 :(
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 Sort. The first element (in the sorted array) will be taken for sure so, find the maximum array index which is less than or equal to (first element + l), if there are less than n elements then print 0 and exit. Else, starting from this index move backward and pick greedily such that there are enough of elements ahead of it. Hopefully, it is correct.
 » 4 years ago, # |   +19
 » 4 years ago, # |   +18 OMG, in problem D i thought i CAN NOT make pillar higher then H...
•  » » 4 years ago, # ^ | ← Rev. 2 →   +3 me, too...... It isn't he say "no sand should go over the fence"?
•  » » 4 years ago, # ^ |   +6 Yup, same here. I need to learn to read statements.
 » 4 years ago, # | ← Rev. 2 →   +23 Why everyone is doing hash for F? There is a 24-hours hacking phase await... (don't know if random power base can save us from this)
•  » » 4 years ago, # ^ |   0 Is it possible to hash large subsets with one modulo? I thought about this during the contest but decided that collision probability would get too high...
•  » » 4 years ago, # ^ |   0 Can you explain your solution ?
•  » » » 4 years ago, # ^ | ← Rev. 2 →   +9 It works like this:First we replace each letter in S with the distance to the nearest same letter on the right, or ∞ if there's no such letter. E.g. "abacaba" becomes [2, 4, 2, ∞, 2, ∞, ∞]. This takes O(n) time. Now instead of a sequence of letters, we have ≤26 interleaved linked lists — one for each letter type in S.If substrings X and Y are isomorphic, then all elements of linked lists that form X must be identical to those which form Y, except the last elements, since they point outside our region of interest.Therefore, X and Y are non-isomorphic, iff there is an index i, s.t. X[i] != Y[i] && (X[i]+i < len(X) || Y[i]+i < len(Y)). To find i, we quickly (using a lcp array) iterate over all j, X[j] != Y[j] and check X[j]+j < len(X) || Y[j]+j < len(Y). We will do at most 26 iterations, because X[j]+j >= len(X) means that j was the last occurrence of the letter at j.
 » 4 years ago, # | ← Rev. 2 →   0 [PROBLEM C] Could you tell me where i wrong? My solution got wrong answer on pretest 6 https://ideone.com/Xfb3Ek
•  » » 4 years ago, # ^ |   0 Tets: 2 3 2 1 2 3 4 5 6 Your Answer: 6 Correct Answer: 4
•  » » » 4 years ago, # ^ |   0 please figure out my false
 » 4 years ago, # |   +18 Problem E was a subtask of this problem : Here
•  » » 4 years ago, # ^ |   +6 also this problem: Here...
 » 4 years ago, # |   +14 38507649I made a stupid mistake in 985F - Isomorphic Strings.Come and hack me >///
 » 4 years ago, # |   0 Can you believe it, I assumed that the positions in A were sorted. Couldn't figure out this till the end and got WA. Not complaining, but the examples could have been 'unsorted'? :(
•  » » 4 years ago, # ^ |   +8 Same for E, (cost me one WA) but to be honest it's up to the contestants to read the problems carefully.
 » 4 years ago, # |   +122
 » 4 years ago, # |   0 How to solve E? (My greedy solution got hacked)
•  » » 4 years ago, # ^ |   0 You fail on this case in case you were wondering:6 3 32 2 2 4 7 7Answer is yes.
•  » » » 4 years ago, # ^ |   0 Thanks :)
 » 4 years ago, # |   +26 Seems that uwi is on a killing spree for Problem F...
•  » » 4 years ago, # ^ | ← Rev. 2 →   +10 I tried to hack solutions of rolling hash of 2 const modulo after waking up, but the contest had finished.To hack rolling hash by 1 const modulo is very easy by birthday attack.
 » 4 years ago, # |   0 how to solve D?
 » 4 years ago, # |   +3 1000000000000000000 1 For this case how the answer be 1999999999
•  » » 4 years ago, # ^ |   0 1 2 ... 999999999 1000000000 999999999 ... 2 1
•  » » » 4 years ago, # ^ |   0 no sand from the leftmost spot should go over the fence; What does it mean then?
•  » » » » 4 years ago, # ^ |   +3 Only h1 must be less than or equal to H (so that it doesn't get over the fence). For other pillars they have no restriction on their absolute heights; their heights only need to have at most difference of 1 to their neighbors' heights.I've been thinking wrong about this during the whole contest, and I had no idea why I was getting WA on test 7. Now I feel really bad that I couldn't realize this :(
•  » » » » » 4 years ago, # ^ |   0 Okay, then why the answer to the case 20 4 be not 6? here 1 2 3 4 5 5 = 30.
•  » » » » » » 4 years ago, # ^ |   +9 1+2+3+4+5+5=20.If 1 is your h1, meaning that it is the pillar that is leaning against the fence, then the other side has to descend from 5 to 1. It can't just stop at 5 abruptly.
•  » » » » » » » 4 years ago, # ^ |   0 get it. thank you.
•  » » » » » 4 years ago, # ^ |   +6 I got 5 wrong submissions because of this. Luckily I realized it during the contest. Misreading statements is one of my specialties.
 » 4 years ago, # | ← Rev. 2 →   0 Why are "acc" and "cac" not isomorphic for problem F?
•  » » 4 years ago, # ^ |   0 because it is not bijective. f('a') = 'c' and f('c') = c(for 3rd character of 'aac')
 » 4 years ago, # |   0 Anybody idea for E.
•  » » 4 years ago, # ^ | ← Rev. 3 →   +8 CodeMy solution for E:first we sort all pencils.we define dp[i]: is it possible to solve problem for pencils 1 to i.and d[i]: greatest j (j <= i) that dp[j] = 1.now we put x = d[i — k] and after that if a[i] — a[x + 1] <= d then dp[i] = 1 else dp[i] = 0.and d[i] = i if dp[i] = 1 else d[i] = d[i — 1].(sorry for bad English)
•  » » » 4 years ago, # ^ | ← Rev. 2 →   +1 Why are you taking x = d[i — k]? Can you elaborate more on that?UPD : Got it NVM.
•  » » » » 4 years ago, # ^ |   +4 In last box there are at least k pencils so we have to find rightmost j thatj <= d — k and dp[j] = 1 now check that pencils j + 1 to i can be in one box or not?
•  » » » » » 4 years ago, # ^ |   0 Yeah figured it out. Thanks for the help :)
•  » » » » » » 4 years ago, # ^ | ← Rev. 2 →   0 You're welcome ;D
•  » » » 4 years ago, # ^ |   0 In Problem E,why is that if a solution exists, there exists partitions such that they form contiguous segments of the Array.Thanks in advance .
•  » » » » 4 years ago, # ^ |   0 First we sort the array so in each partition (max — min) will be minimize.
•  » » 4 years ago, # ^ | ← Rev. 2 →   +4 -sort the array-find a slow dp solution : O(n^2)-try to optimize it to a faster dp solution : O(n * logn) or O( n )
•  » » » 4 years ago, # ^ |   +12 -try harder to optimize it to O(n)
•  » » » » 4 years ago, # ^ |   +4 sure
•  » » » » 4 years ago, # ^ |   0 Is it possible to do it without sorting the array at all then ?
•  » » » » » 4 years ago, # ^ |   0 I don't think there is
•  » » » » » 4 years ago, # ^ |   0 you can use radix sort. but i meant O(n) algorithm after sort.
•  » » » » » » 4 years ago, # ^ |   0 If you mean On after sort, it can use deque to maintain dp arrays .
 » 4 years ago, # | ← Rev. 2 →   -54 D was the worst possible type of tasks for me. It's a pity it appeared in the contest, even more that it was placed before E, which was quite easy for me.Also I'm not sure that the round should be rated as I started coding D because at the time of making a decision, E was not solved by anybody (so E appeared to be harder than D), due to the error. Issues in E had impact on many participants. I believe I got 3 problems instead of 4 due to that.
•  » » 4 years ago, # ^ |   +16 Wait, this happened about half an hour into the contest. Wasn't that your fault to spend the rest of the time on the problem of your weaker topic instead of reading the other ones? I'm sure that the ranklist after half an hour tells nearly nothing about the difficulties of the problems.
•  » » » 4 years ago, # ^ |   -30 I checked more precisely. At the time I was looking at the next task (after solving C), there should have been 23 E solutions accepted already, this was the last one:http://codeforces.com/contest/985/submission/38494892At the same time there was 0 accepted solutions to E and there were 11 accepted solutions to D, the last one: http://codeforces.com/contest/985/submission/38495105I have no reason to lie, as I said I expect a positive rating change. If I had seen these numbers when I was making a decision I would have started with E.I just have a feeling that the issue with E is sufficient to make this contest unrated. I was impacted indirectly but many people were impacted directly.Besides — there was incorrect author's solution, this fact should make the whole round unrated, given ACM rules. I object to policy of making rounds rated just to please the maximum number of people. Rounds should be unrated unless they ran perfectly in 100%.What do you think MikeMirzayanov?
•  » » » 4 years ago, # ^ | ← Rev. 2 →   +2 UPD: My fault... See comments below.Well, it is a good round ... but problem D. (No offensive).Even though problem D itself is a good one, but it is not very friendly to the CPPers.We need to handle two long long multiplication carefully. ( Aha! I know it! I avoid this! )And then math functions bring floating errors! ( WHAT? )Should "handling floating errors" really be the part of the contest?My key point is : D is a good problem, but it shouldn't make certain languages better than others.(Making D's limit into 109 would be a better choice, I don't know any brute force that can pass 109 but not 1018).
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   +6 We had a solution and didn't really want it to pass. It's like one step easier than the intended one.All calculations in my solution are performed using only integer types and fit into long long.
•  » » » » » 4 years ago, # ^ | ← Rev. 2 →   +3 Thanks for replying. We had a solution and didn't really want it too pass. It's like one step easier than the intended one. OK, then I have no problem with D's limit. All calculations in my solution are performed using only integer types and fit into long long. So, you mean that long double is intended to fail ? Should "using long long instead of long double" be a part of the contest ? Maybe it should be but I don't know ? Really, worst time ever : getting WA on test 7 but the logic of the program is absolutely right, struggling whether to submit again or to give up.
•  » » » » » » 4 years ago, # ^ |   0 If you have to multiply numbers that big then you are doing something wrong? I mean, use long double as much as you want to if you are sure in the correctness of the answer you get. Or you can think a bit more and get a much smaller estimation on the borders of binary search.
•  » » » » » » » 4 years ago, # ^ | ← Rev. 4 →   0 No, not that, I said I avoid long long mutiplications.I got WA using ceill(n/X) but AC (preliminary) using following code:for(; n>0; n -= X, ++Ans);I don't think it is wrong using ceill(n/X).
•  » » » » » » » » 4 years ago, # ^ |   +5 Actually, you output 2e+009 instead of 1999999999. Maybe this was the problem, not the precision of calculations?
•  » » » » » » » » » 4 years ago, # ^ | ← Rev. 2 →   +5 Yeah, I just saw that.Thanks. Sorry for bothering. It's my fault.
•  » » » » » » » » » 4 years ago, # ^ |   +5 No problem, it happens :D
•  » » » » 4 years ago, # ^ |   0 I pass it using long double...(after contest q_q)
•  » » » » » 4 years ago, # ^ |   0 ...
•  » » » » » 4 years ago, # ^ |   0 I am getting WA using long double...I am pretty sure it's due to floating errors.38530049..Please help
•  » » » » » » 4 years ago, # ^ |   0 only use long double when you dont need accurate number
•  » » » » » » » 4 years ago, # ^ |   0 Thanks for the help JayZhan
•  » » » 4 years ago, # ^ |   0 To make it more clear — maybe it wasn't understood for the first time.If there were no issues, that would have been my fault 100%. However in this particular case, my decision was biased by the bug in writer's solution.I also think that it might be the case with more people as the difference in accepted solutions between D and E is very small, while it should be something like 250 for D and 450 for E, but I guess that many more competitors jumped to D as they saw that nobody was able to solve E for almost an hour.
•  » » » » 4 years ago, # ^ |   0 Most people also do the problems in order because they expect them to be in order of difficulty.
•  » » 4 years ago, # ^ |   +29 The worst excuse ever.
•  » » » 4 years ago, # ^ | ← Rev. 2 →   -6 It is not an excuse as I will probably get positive rating change after this contest (at least this was my knowledge when writing this post)... And I'd rather give it up for unrated round as I feel that this contest was interrupted by the bug.It just demonstrates the subtle impact of the issue. I based my decision on the number of problems solved and I got stuck on D until the end of the contest and I have a reason to believe it would not have been the case, but for the mistake.As regards previous comment — it is not true. After 40 minutes I should have seen comparable number of solutions to both problems. If I see around 30 solutions on D and 0 on E, it is a clear indicator for me that D should be easier than E (not everyone should follow this logic).
 » 4 years ago, # |   0 Why I got RUNTIME_ERROR in pretest 7? 38505110
•  » » 4 years ago, # ^ |   0 The error is caused in this line:while(cnt && abs( *(s.rbegin()) - *L ) > l )You are trying to access to the value pointed by L, but a few lines before, you erased that value from the set. I saved *L in a variable before deleting it from the set, and the Runtime Error was gone, but now it gives Wrong Answer. I'm not really sure what's the idea behind your code, so I can't help you with that. I hope this comment helps you solving the problem :)PD: there is another error in that line: you forgot to check that the multiset is not empty before trying to erase an element from it. That may cause Runtime Error too. Bye!
 » 4 years ago, # |   0 can anyone help with a good test case for problem E ? cannot Figure out where it could go wrong. #noob
 » 4 years ago, # |   -8 Hi, I just wanted to mention that it seems that users with rating above 2100 are registered as official contestants... or at least they don't disappear when I unset the "show unofficial" checkbox.Hope that doesn't causes any problem.
•  » » 4 years ago, # ^ | ← Rev. 2 →   +6 Educational rounds are rated for users with rating below 2100, but it doesn't mean other users are unofficial. I think, In those rounds all users are welcome to participate officialy.
 » 4 years ago, # |   +22 In contests page, the hacking phase for this round seems to be for 12 hours rather than a day.
 » 4 years ago, # |   +3 Problem D is similar to SRM 721 Div1 Easy.
 » 4 years ago, # |   +5 For problem F,if the size of alphabet is up to 10^5 or larger and other constraints remain the same,is there any approach to solve it?
 » 4 years ago, # | ← Rev. 2 →   0 Can anyone tell me Problem F why my solution get WA on test 16's 9259th query? I have been debugging for more than five hours. qaq. this is my submission code: 38512729
•  » » 4 years ago, # ^ |   +3 Don't write hashes modulo 2^64 linkThe string in 16's test is Thue–Morse sequence
•  » » » 4 years ago, # ^ |   +5 This is the first time I know that it looks so magical. Thank you very much for your reply.
 » 4 years ago, # | ← Rev. 2 →   0 As a novice, I have a question for everyone. Why did I submit the same code twice, but one got AC, another got WA. 38509969 during the game. 38524984 after the game
•  » » 4 years ago, # ^ |   0 Editorial??
•  » » 4 years ago, # ^ |   +5 Submit with diagnostics. Perhaps you have some undefined behavior due to the overflow or memory access.
•  » » » 4 years ago, # ^ |   0 yes...thanks
•  » » 4 years ago, # ^ |   +5 emmm.. I think your code "if(n-que.front().w
•  » » » 4 years ago, # ^ |   0 maybe you are right. modified code got ac...thanks...but i still can't understand why i got a different result
•  » » » » 4 years ago, # ^ |   0 maybe it's magic..hah
 » 4 years ago, # |   0 Problem C:Why I got TLE Verdict?38494646I didn't use while() so there are some troubles on sort?
•  » » 4 years ago, # ^ |   0 qsort has worst case O(n^2) I think.
•  » » » 4 years ago, # ^ |   0 Oh... I understand thxHow to fix it?
•  » » » » 4 years ago, # ^ |   0 Use inbuilt STL sort — sort(ar,ar+n) where ar ->array and n->size of the array.
•  » » » » » 4 years ago, # ^ | ← Rev. 2 →   0 Fix my code to use STL sort, I got AC. thank you! 38527514
•  » » 4 years ago, # ^ |   0 The test was designed specifically to counter quicksortsI was hacked with this once actually
 » 4 years ago, # |   0 System test has finished,so is it rated?
•  » » 4 years ago, # ^ |   0 why not rated?
•  » » » 4 years ago, # ^ |   -14 Issue of the writer's solution was wrong on Problem E(And not clear words on Problem D?)
•  » » » » 4 years ago, # ^ |   0 so it's unrated? but Problem E's tests are right?
•  » » » » » 4 years ago, # ^ |   -6 The test case was fixed after 45min the contest started(and affected some verdict).I think some contestants waste the time because of the issue, so it's good that this contest change to unrated (or semi-rated).
•  » » » » » » 4 years ago, # ^ |   0 is this contest really unrated.
•  » » » » » » » 4 years ago, # ^ |   0 UR?My Rating was changed a few minute ago.
•  » » » » » » 4 years ago, # ^ |   0 Why not wait 10 more minutes and then discuss whether it is rated? :)
 » 4 years ago, # |   +4 when will the editorials be updated?
 » 4 years ago, # |   0 The rating were changed so it's rated
 » 4 years ago, # |   0 does hacking a solution not effect our rating
•  » » 4 years ago, # ^ |   0 In educational rounds, No.
•  » » » 4 years ago, # ^ |   +1 then what's the fun of hacking other's solution
•  » » » » 4 years ago, # ^ |   +5 then why do Div1 participate in Div2/ Div3 or Educational rounds?
•  » » » » 4 years ago, # ^ |   +5 To educate others :D
•  » » » » 4 years ago, # ^ |   +5 For fun.
 » 4 years ago, # |   +18 Is there any solution for F except O(N * 26)?
•  » » 4 years ago, # ^ |   +17
 » 4 years ago, # |   0 Auto comment: topic has been updated by awoo (previous revision, new revision, compare).
•  » » 4 years ago, # ^ |   +8 When will you upload Editorial??
•  » » » 4 years ago, # ^ |   0 Soon
 » 4 years ago, # |   0 How could i optimize my submission which got TLE on 68the case ?
 » 4 years ago, # |   +38 Thanks for div2 only contests !11!1
 » 4 years ago, # |   0 __i use ideone to run the code but the solution is copied and i get unrate. Does my computer have malicious code? Explain me, please.
•  » » 4 years ago, # ^ |   +5 ideone is by default public. you can see submissions in https://www.ideone.com/recent. Maybe someone copied from there. keep your submissions private from now on. Its an incognito type icon near stdin below input text box.
•  » » » 4 years ago, # ^ |   0 Thank you very much ! I ever never know :D
 » 4 years ago, # |   +8 Where is the editorial ?
•  » » 4 years ago, # ^ |   0
 » 4 years ago, # |   0 Auto comment: topic has been updated by awoo (previous revision, new revision, compare).
 » 4 years ago, # |   +6 In Question C,I had got time limit exceed in test case 19 in java while with same algorithm (same code) in C++ is able to pass all test cases.
•  » » 4 years ago, # ^ |   0 Same issue
•  » » 4 years ago, # ^ |   0 Same issue!
•  » » 4 years ago, # ^ |   +17 You made well-known mistake: Arrays.sort() -> Collections.sort(). Sort in Arrays has O(n^2) in worst case.
•  » » » 4 years ago, # ^ |   0 Solved,Thank you!
 » 4 years ago, # |   0 Why my output for large inputs coming 0 for question C ? https://ideone.com/0wQyKD
 » 4 years ago, # |   0 In problem D, when I use round() function to round the division operation to nearst integer value it causes me WA in testcase 18 though the round function isn't making any difference!round() is not making difference: http://codeforces.com/contest/985/submission/38600633and all of this solutions provide correct output -1 in my local machine!
 » 4 years ago, # | ← Rev. 2 →   0 Thank you.