### map's blog

By map, 4 years ago, translation, ,

Hello, Codeforces! I'd like to invite you to Codeforces Round #289 (Div. 2). It'll be held on Saturday, January 31 at 15:00 MSK and as usual Div. 1 participants can take part out of competition.

This round will be carried out according to the ACM rules, which means that you get verdict of your solution on-line, and the duration time is 3 hours.

These differences in the rules are caused by the fact that this round is the second qualifying round for the WCC, which stands for Winter Computer Camp and can be also mentioned as ZKSH. Official school website — hhttp://it-edu.mipt.ru/en/zksh2015. There you can find the selection rules for WCC.

If you are a school student and you want to participate in the selection to WCC here are the steps:

1. Sign up for the school at http://goo.gl/kz2qSf, if it was not done earlier.
2. Create a free account at codeforces.com, if it was not done earlier.
3. Sign up for the round on the link http://codeforces.ru/contestRegistration/509. You should put a tick in the box "Do you want to participate in the selection to WCC?", and provide your last name, first name and email, which you entered for registration in the first step.

If you have any questions feel free to write to the address of the organizing committee: zksh-team@phystech.edu.

The authors of the contest (WCC technical committee) are really grateful to Max Akhmedov (Zlobober) for the help with preparation of this round, Maria Belova (Delinur) for translation of statements and Mike Mirzayanov (MikeMirzayanov) for contribution to the development of programming by creating systems Codeforces and Polygon.

UPD. Tutorial — http://codeforces.com/blog/entry/16119

• +155

 » 4 years ago, # | ← Rev. 4 →   0 I have 2 question :1)Are there any T-shirts ?2)rated?
•  » » 4 years ago, # ^ | ← Rev. 2 →   +14 1) According to the results of the competition, top 5 students, who will take part in WCC, will receive prizes. 2) Rated, I hope =)
•  » » » 4 years ago, # ^ |   0 thank you :)
•  » » 4 years ago, # ^ |   +5 if it is not rated then why it is div2 only?
•  » » » 4 years ago, # ^ |   +8 it is rated only for div2 participants
 » 4 years ago, # |   +19 You can use this picture :)
 » 4 years ago, # |   +6 Can Div1 contestant participate in the selection to WCC?
•  » » 4 years ago, # ^ |   +1 Yes, of course
 » 4 years ago, # |   +14 The sign-up is in Russian. Is the WCC available only for Russian speaking students?
•  » » 4 years ago, # ^ |   +9 If you look closely, there are English translations below each Russian statement.
 » 4 years ago, # |   +15 I want to know how many questions are there?
 » 4 years ago, # | ← Rev. 2 →   -9 I think 5000 users register for contest :)
 » 4 years ago, # |   +35 During the contest I can realize that I am in Computer AGE.
•  » » 4 years ago, # ^ |   -10 are you??
 » 4 years ago, # |   +6 Will the problems be arranged according to the expected order of difficulty? Also will there be a scoring system or we'll be rewarded on problem count and submission times with 20 mins penalty for wrong submissions?
•  » » 4 years ago, # ^ |   +3 "we'll be rewarded on problem count and submission times with 20 mins penalty for wrong submissions" is correct. I can't promise anything about tasks.
•  » » » 4 years ago, # ^ |   0 Okay , thank's.
 » 4 years ago, # |   -7 I hope that these rules used in all contests on codeforces ..
 » 4 years ago, # |   +5 Standard input/output? How many tasks?
 » 4 years ago, # |   -18 Hacks or no hacks?
•  » » 4 years ago, # ^ |   +17 Full feedback.
•  » » » 4 years ago, # ^ |   -15 :(
 » 4 years ago, # |   -6 is this rated?
•  » » 4 years ago, # ^ |   0 for div2 yes
 » 4 years ago, # |   0 Can I participate in this contest without signing up/registering for WCC?
•  » » 4 years ago, # ^ |   0 Yes, of course
•  » » » 4 years ago, # ^ |   0 Thanks...
•  » » 4 years ago, # ^ | ← Rev. 2 →   +7 TODO: update comments before sending.
 » 4 years ago, # |   +2 What time during the contest will the scoreboard be frozen?
•  » » 4 years ago, # ^ |   -16 No freeze
•  » » » 4 years ago, # ^ | ← Rev. 2 →   +57 It looks like scoreboard is now frozen, if I am correct.
 » 4 years ago, # |   +2 Hope to become expert this round))
 » 4 years ago, # |   -11 你好
•  » » 4 years ago, # ^ |   0 Are you sure that people in here can understand what you say?
•  » » » 4 years ago, # ^ |   0 Google translate: "Hello" Chinese.
 » 4 years ago, # | ← Rev. 2 →   +1 By using ACM ICPC rules, does it imply that the language restricted (only C, C++, Java)? I hope it does not.UPD: my bad. I just opened the rules. We can also use Pascal and Python.
•  » » 4 years ago, # ^ |   +6 I think, every language supported by Codeforces, will be available.
•  » » » 4 years ago, # ^ |   +1 Oops, my bad (again). Thanks for the clarificaton, nic11! :)
•  » » » 4 years ago, # ^ |   +3 You are absolutely right.
 » 4 years ago, # |   0 let the game begin.. Good luck for all
 » 4 years ago, # |   0 It's 15 minutes past the contest .. and I can not submit my code for A :/
 » 4 years ago, # |   +29 Nice System Of A Down reference in Problem E :)(IEAIAIO and BYOB are both songs by System Of A Down)
 » 4 years ago, # |   +24 And dreamoon finally has done it! Congrats!
•  » » 4 years ago, # ^ |   +8 yeah he did it! Congratulations! =D
•  » » 4 years ago, # ^ |   +7 i'll wait for dreamoon vs sorry_dreamoon again :)
 » 4 years ago, # | ← Rev. 2 →   0 Nice problem :)thanks map
 » 4 years ago, # |   0 Sorry to say this but, imo(i dont know about others) your problemset was the worst i've seen in codeforces.
•  » » 4 years ago, # ^ | ← Rev. 2 →   +37 Why do you think so? I really liked problems, especially F, even though I have no idea how to solve it.
•  » » » 4 years ago, # ^ |   -20 Well i myself dunno how to solve F but A-D were really bad
•  » » » » 4 years ago, # ^ |   +10 What are you talking about? They were really good problems. Also, problemsetters put a lot of their time and effort into making such problems. Try to be grateful and don't dishearten them with such comments.
•  » » » » 4 years ago, # ^ |   +8 What is bad in D?
•  » » » » 4 years ago, # ^ |   0 F was nice, but yeah I didn't really like many of the others.
•  » » 4 years ago, # ^ |   0 That problem C -_-
 » 4 years ago, # |   +3 what is the 7th test case in problem C?
•  » » 4 years ago, # ^ |   +2 same problem
•  » » 4 years ago, # ^ |   0 I don't know the test itself but what's your soln for this input?2 300 300
•  » » » 4 years ago, # ^ |   0 3999999999999999999999999999999999 4899999999999999999999999999999999
•  » » 4 years ago, # ^ |   0 Try 10 38 38 38 38 38 38 38 38 38 38answer: 29999 38999 39899 39989 39998 47999 48899 48989 48998 49799
•  » » » 4 years ago, # ^ | ← Rev. 2 →   0 my code prints the same as yours, but still wa at 7
•  » » » » 4 years ago, # ^ |   0 what about 8 1 1 1 1 1 36 20 21 answer: 1 10 100 1000 10000 18999 19019 19029
•  » » » » » 4 years ago, # ^ |   0 I see, thanks
 » 4 years ago, # |   0 How do you solve E ? I feel it is dp but not sure how.
•  » » 4 years ago, # ^ |   0 you can have a look at my solution .. i did it so simple you even can't believe .
•  » » » 4 years ago, # ^ |   0 Is it faster than O(nlogn)? I can't view your solution now.
•  » » » » 4 years ago, # ^ |   0 is is O(n)
•  » » » » » 4 years ago, # ^ |   -10 it is*
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   +2 My solution is O(n).
•  » » 4 years ago, # ^ | ← Rev. 18 →   +8 Let call ai = 1 if si is a vowel else ai = 0. sumi = a1 + a2 + ... + ai Number of vowels in all sub-strings with length x is: Pi = (sumx — sum0) + (sumx + 1 — sum1) + ... = (sumx + ... + sumn) — (sum0 + ... + sumn - x) The result is sum of Pi / i
•  » » 4 years ago, # ^ |   0 there can be something like this http://pastebin.com/E2pCyWmu
•  » » 4 years ago, # ^ | ← Rev. 3 →   0 I didn't solve it either but I think it's dp too. We look at each letter independently and if it's vowel we add to answer sum of some harmonic serieses (we can calculate it using this value for last letter and array of prefix sums of harmonic series)UPD: now I see that I was wrong and it can be solved easier another way.
•  » » 4 years ago, # ^ | ← Rev. 5 →   0 Consider the vowel in the string at the position i. It contributes to the answer only addends of the form , where k ≥ i and j ≤ i, because it is only contained in the substrings of the form si..j, j ≤ i ≤ k. After what, we can sum this expression for all i, j, k such that si is a vowel and j ≤ i ≤ k. Plugging this into WolframAlpha, we can get the final formula for the answer: , where Hi = 1 + 1 / 2 + ... + 1 / i is the i-th harmonic number.
 » 4 years ago, # |   -8 Will this round really be rated for div2 or not?
 » 4 years ago, # |   +3 When will we be able to look at others' solutions?
 » 4 years ago, # | ← Rev. 2 →   +5 How to solve problem C? I saw a lot of accept is this problem, but I didn't know how to do it.
•  » » 4 years ago, # ^ | ← Rev. 2 →   +3 At the each step remember a last output value and a sum of digits in it. Then add 1 to last value and try to get the smallest integer which has the desirable sum of digits. To do it basically set less significant digits to 9 if you need to make sum of digits larger or set them to 0 (and +1 to digits before them) if you need to make it lesser.Use bignum arithmetic.
•  » » » 4 years ago, # ^ |   0 Thanks a lot!
•  » » » 4 years ago, # ^ | ← Rev. 2 →   0 What if the sum of digits is same?How can we determine just next bigger number?
 » 4 years ago, # |   0 Hi, when will the practice problemset become unlocked?
 » 4 years ago, # |   0 Any idea about how to solve prob. E ?
•  » » 4 years ago, # ^ | ← Rev. 2 →   +1 Magic 9648904
•  » » » 4 years ago, # ^ |   +11 Why magic? :)
•  » » » » 4 years ago, # ^ | ← Rev. 3 →   0 Its my code: 9652904 I have no idea about how you code works. My solve calculate count of intervals with length one divided by one, length two divded by two (etc.) for all positions (array VAR).
•  » » 4 years ago, # ^ |   +5 It took me half an hour to push formula...And I solved this problem. answer=(1/2 + 1/3 + ... + 1/n)(a[1]+a[n])+2*(1/3 + ... + 1/n)(a[2]+a[n-1])+...+(n-1)(1/n)(a[n-1]+a[2])+a[1]+a[2]+a[3]+...+a[n] if a[i] = I or E or A or O or U or Y then a[i] = 1 n means length of string And it's my code: http://codeforces.com/contest/509/submission/9654437 :-)
 » 4 years ago, # |   +4 I really wrote bad and long solution for C but finally I got accepted :D
•  » » 4 years ago, # ^ |   0 I also wrote bad and long solution for E and I got accepted :-)
•  » » » 4 years ago, # ^ |   +14 Your E solution is actually three times shorter than mine. It's not bad and long solution in my opinion o.O
 » 4 years ago, # |   +9 When clicking on submit button on the right, I sometimes had to wait around 3-5 minutes before my solution got accepted since previous 3 contests. :(All other websites were working in a decent speed on my internet connection during the time of the contest. Has somebody else faced this lag, or I do I need to get an alternate connection.
•  » » 4 years ago, # ^ |   0 same here site page for submit will not open..
•  » » 4 years ago, # ^ |   0 It is always laggy for me too while I am in college but works fine when I am at home . You could go to IPC or library for faster speed.
 » 4 years ago, # |   0 map, when the editorial would be available ?
•  » » 4 years ago, # ^ | ← Rev. 2 →   +2 Part of tutorial is availableWe hope to finish it today.
•  » » » 4 years ago, # ^ | ← Rev. 2 →   +8 AlexDmitriev, Your llink is the link of this post, no editorial. :(UPD: I think Now it is fixed.
•  » » » » 4 years ago, # ^ |   +1 Fixed, thanks
•  » » » » » 4 years ago, # ^ |   +3 AlexDmitriev, Thanks for the link and a big hand for the editorial. :)
•  » » » » » 4 years ago, # ^ |   0 Hi, do you happen to know when the problemset part of the site becomes unlocked?
•  » » » » » » 4 years ago, # ^ |   0 Unfortunately, I don't know it. Probably some action from administration is needed.
 » 4 years ago, # |   0 http://codeforces.com/contest/509/submission/9645857 Why am i getting Wrong Answer on test 1, output is correct on my pc.
•  » » 4 years ago, # ^ |   0 But in the system and ideone, your program gives "NO" as the output of the first test case, while the answer should be "YES"
•  » » 4 years ago, # ^ |   0  FOR(K, 0, 102) { if(abs(c1[K]- c2[K]) > 1) { f = false; break; } } but your array sizes are 102 and your for loop define is <=`.Don't try to use defines if you are not familiar with them.
•  » » » 4 years ago, # ^ |   0 Got it thanks
 » 4 years ago, # |   0 Nice contest. Me mostly enjoyed problem C, stringy one.
 » 4 years ago, # |   -16 Good Luck Everybody :D