By ADJA, 3 years ago, translation, ,

Hello, Codeforces!

My name is Adilet Zhaxybay, and together with Bekzhan Kassenov (Bekzhan.Kassenov) we are authors of Codeforces #294, which will be held on 28th of February at 16:00 MSK. This is our first Codeforces round and we are happy to invite all of you to participate in it. The round will be rated for the second division, however, participants from the first division can, as usually, participate in it unofficially.

As far as we know, it is the first Codeforces round, which was completely prepared by the authors from Kazakhstan. We are very honored by this fact and hope that everything will go great. We are encouraging other participants from our country to join us — I am sure, that you can prepare a lot of very nice problems. Preparing Codeforces round is possible ;)

We want to thank all the people, who helped us to prepare the contest: Max Akhmedov (Zlobober), who helped us with the problems, Nurlan Kanapin (kt-9) and Mansur Kutybaev (Mex-Mans), who tested the round, and Maria Belova (delinur), who translated problem statements.

Also we want to say great thanks to Mike Mirzayanov (MikeMirzayanov) for creating Codeforces and Polygon. We want to congratulate Codeforces with its fifth anniversary. We, authors of the round, were very lucky to start competitive programming at the time, when Codeforces already existed, and it helped us really a lot!

We love, when authors of the round write a bit about themselves (we encourage everybody to do so) — this helps to feel that there are real people behind the problems. Thus, we will write a bit about ourselves. We are students from Nazarbayev University (nu.edu.kz). NU is a new university with English as a language of teaching, which is located in the capital of Kazakhstan, Astana. Our university participates in ACM-ICPC only from 2012, but the team from NU already qualified to World Finals twice — in 2014 and 2015. We hope that we will do only better in the future!

Good luck to all!

UPD Score distribution will be standard (500 — 1000 — 1500 — 2000 — 2500)

UPD2 Editorial is available here

Congratulations to winners!

Round is over, thanks to everybody, who took part in it!

•
• +347
•

 » 3 years ago, # |   +4 Hope for finally become blue :)
•  » » 3 years ago, # ^ |   -45 Do not hope You never gone blue
•  » » » 3 years ago, # ^ |   0 you become purple
•  » » 3 years ago, # ^ |   +20 My hope has been granted :)
•  » » » 3 years ago, # ^ |   0 Congrats! Mine too. :)
•  » » 17 months ago, # ^ |   0 If you want, you can!
 » 3 years ago, # |   +13 Congrats for being first in country to prepare a codeforces round. Hoping your efforts will inspire many people in your country.
•  » » 3 years ago, # ^ |   +7 For the sake of fairness: azizkhan was one of the authors of Codeforces Round #202. We are just first, who prepared complete round.
 » 3 years ago, # |   +33 Wahhey, first complete round from my country!
•  » » 3 years ago, # ^ |   +11 Always dreamed to write this comment (
•  » » 3 years ago, # ^ |   -15 afarin be country shoma
 » 3 years ago, # | ← Rev. 2 →   +9 This contest overlaps with Challenge24 :(
•  » » 3 years ago, # ^ |   -65 you boro challenge24 bede we haminja contest midim
•  » » » 3 years ago, # ^ |   +7 Can you shut up please?!
•  » » » » 3 years ago, # ^ |   -35 no I can't (:
 » 3 years ago, # | ← Rev. 3 →   +33 As far as we know, it is the first Codeforces round, which was completely prepared by the authors from Kazakhstan. I am really sorry bekzhan29)
 » 3 years ago, # |   +5 Why isn't this page on the frontpage? Isn't this an official contest?
•  » » 3 years ago, # ^ |   0 It's an official contest. Just appeared on the front page.
 » 3 years ago, # | ← Rev. 2 →   +7 hope we enjoy the problems
•  » » 3 years ago, # ^ |   -24 we too (:
•  » » » 3 years ago, # ^ |   +9 Attention guys, it's an individual contest.
 » 3 years ago, # |   -57 In this world, winning is everything; winners are validated and losers are denied. Until now, I've never lost at anything, and I won't in the future. Since I always win, I'm always right. If you oppose me... I'll kill you, no matter who you are.
•  » » 3 years ago, # ^ |   -19 miay teeworlds?
•  » » 3 years ago, # ^ |   +15 Ya, we know that by looking at the time you created your account at.
•  » » 3 years ago, # ^ |   +9 teach me how to spout nonsense without getting embarrassed please because the things you just said made laughing a medicine for me =))
•  » » 3 years ago, # ^ |   +49
•  » » 3 years ago, # ^ |   +11 I'm pretty sure everyone is so much concerned with their lives and won't dare to oppose you. But I was just wondering what if the Online Judge oppose you and give you a verdict other than Accepted!
•  » » » 3 years ago, # ^ |   -32 That cant happen because i am always right, i make no mistakes
•  » » 3 years ago, # ^ |   +16 I think he is just acting like the character Akashi Seijuro... Those words were all originally from the anime....
•  » » » 3 years ago, # ^ | ← Rev. 2 →   0 i am not acting, i am Akashi. winning is everything and i never lose as you can see in standings
•  » » » » 3 years ago, # ^ |   +10 Next round you will be introduced with div 1 coders.
•  » » » » 3 years ago, # ^ |   +3 just look tourist and shut up :|
•  » » 3 years ago, # ^ |   +3 look for help bro :)
•  » » 3 years ago, # ^ |   0 @Akashi: Sorry but you will loose both in the anime and in div1 soon :)
 » 3 years ago, # |   -23 I am ze ghamat very very sorry pictureato bede for yadegaripls dis like me for kossher haye bala
•  » » 3 years ago, # ^ |   -15 chi kos migi ?
•  » » » 3 years ago, # ^ |   -6 taghriban
•  » » » 3 years ago, # ^ |   -6 kos shero put karde too koonesh dg
•  » » » » 3 years ago, # ^ |   +12 please speak English ! and don't be rude :|
•  » » » » 3 years ago, # ^ | ← Rev. 2 →   -15 Stop fighting :|
 » 3 years ago, # | ← Rev. 2 →   0 Congrats to all the Coders from Kazakhstan... :)
 » 3 years ago, # |   0 I wanted to take a walk today. Maybe I will do it tomorrow. Priority has codeforces :P
 » 3 years ago, # |   +6 Usually I ignore large post, blog and announcement. But this one is so much encouraging that I can't ignore. May be one day I will be an author like you :). Best wishes to you guys.
 » 3 years ago, # |   +3 I thought contest would be delayed for 10 min, but registrants 4965!
 » 3 years ago, # |   0 I missed the contest :-(. I thought it was at 16:00 local time.
 » 3 years ago, # |   +46 I think problems were easier than standard for a Div. 2 contest IMHO.
•  » » 3 years ago, # ^ |   +15 Yes... of course that was first contest of ADJA we hope next contest be better :-"
 » 3 years ago, # |   +1 I'm wondering... What's the test case for problem A that got all these hacks?
•  » » 3 years ago, # ^ |   +18 People thought knight was K lololol
•  » » » 3 years ago, # ^ |   0 I made that mistake :P
•  » » » 3 years ago, # ^ |   0 made that mistake ;)
•  » » 3 years ago, # ^ | ← Rev. 3 →   +3 I use something like this: ....K... ........ ........ ........ ........ ........ ........ ........ (the code will fail this test case if they add 1 for 'K' or 'k')
•  » » 3 years ago, # ^ |   +3 mymap['K'] = mymap['k'] = 3; //this case 
•  » » 3 years ago, # ^ |   +3 Also some people / not in my room :( / use 9 instead of 8 for Q.
•  » » » 3 years ago, # ^ |   0 Wait... Aren't you supposed to use 9 for Q?
•  » » » » 3 years ago, # ^ |   0 Yes... Changing 8 by 9 I mean...
 » 3 years ago, # |   +3 how to solve E??
•  » » 3 years ago, # ^ |   0 I missed the contest but I guess it's related to LCA.
•  » » 3 years ago, # ^ | ← Rev. 2 →   +4 Preprocessing: LCA preprocessing and making an array of heights of nodes (h[]), quantities of nodes in the subtrees (sub[]), ancestors of levels 1,2,4,8,16... If we have ancestors of these levels, we can find ancestor of any level with O(log(N)) time.Solution: if a==b, the answer is n. Else find LCA(a,b)=c. If heights of a and b are the same, the middle is c. We can find ancestors of a and b that are childs of c (call them e and f), because we know that they are a and b ancestors of the (h[a]-h[c]-1)th level (complexity O(log(N))). Then the answer is n-sub[e]-sub[f]. If heights of a and b are not the same, then either h[a]-h[b] is odd — then answer is 0, or is even — then we know where the middle node e is situated. If its child closer to a or b is f, the answer is sub[e]-sub[f].
•  » » » 3 years ago, # ^ |   0 thanks got it ....
•  » » » 3 years ago, # ^ | ← Rev. 2 →   0 WA on test 20 ¿?
•  » » » 3 years ago, # ^ |   0 I solved it that way but I keep getting TLE on 7th test case. My solution--> http://codeforces.com/contest/519/submission/10136461
•  » » » » 3 years ago, # ^ | ← Rev. 2 →   0 Sorry my fault, my code was right but I thought roads in input were correct (i.e. a is closer to the root than b) so it was going on infinite loop. lol
•  » » » » » 3 years ago, # ^ |   0 Also prima[][] is unnecessary here. http://codeforces.ru/contest/519/submission/10138678
 » 3 years ago, # |   +16 C looks easier, than A for me.
•  » » 3 years ago, # ^ | ← Rev. 2 →   +7 I finally find my blade....If you know what I mean :-troll.
 » 3 years ago, # |   0 How do I do E? I know its a tree.
 » 3 years ago, # |   0 How to do C problem.I solved it recursively but dont know how to optimize it for large test case .Thanx
•  » » 3 years ago, # ^ |   0 my solution is to print the minimum of (n+m)/3 and n and m
•  » » 3 years ago, # ^ |   0 Greedily, whichever out of n or m is larger subtract 2 from it and subtract 1 from the other until one of them is smaller than 2 and the other smaller than 1.
•  » » 3 years ago, # ^ |   0 Easiest solution i found was:Ans=(a+b)/3Ans=min(Ans,min(a,b))I doubt this tho
•  » » 3 years ago, # ^ |   +1 ans=min(n,m,(n+m)/3) :)
•  » » » 3 years ago, # ^ |   0 sorry i dont know why i cant upvote this Your solution is correct :)
•  » » 3 years ago, # ^ | ← Rev. 4 →   0 I did it using greedy. while n>0 and m>0 and (n+m)>=3: if n>m then n-=2 and m-=1 else: n-=1 and m-=2 and keep incrementing a counter.
•  » » 3 years ago, # ^ |   0 i did something like this 1+max(solve(n-1,m-2),solve(n-2,m-1));where solve is my function.
•  » » » 3 years ago, # ^ |   0 Did it work? Looks like exponential time to me. Or n^2 if memorized.
•  » » » » 3 years ago, # ^ |   0 no it didn't work instead of it there can be O(1) solution i,e ans=min(m,min(n,(m+n)/3));
 » 3 years ago, # | ← Rev. 2 →   +2 Can anyone tell me how to solve D? I can't wait till Editorial
 » 3 years ago, # |   +1 Who can say 5 pretest of C?
 » 3 years ago, # |   0 How is D solved?
•  » » 3 years ago, # ^ | ← Rev. 3 →   0 i did this:keep this : array[ each partial sum amount ][ each character ] = number of occurences of that character with the amount of partial sum.(by partial sum i mean sum of all values from the first to the i'th character) since the amount of partial sum can be large and also negative you need map ( or unordered_map )when you want to add a new partial sum you must see how many of the previous partial sum and the current character had occured and add this amount to the ans.
 » 3 years ago, # |   +2 what's the meaning of "Validator 'validator.exe' returns exit code 3 [FAIL Expected EOLN (stdin)]" when hack others' code?
•  » » 3 years ago, # ^ |   0 my submitted code is http://codeforces.com/contest/519/hacks/140490/test
•  » » » 3 years ago, # ^ |   +3 After looking, it might be because of the extra space you print at the end of each line... I'm not sure but I know that the validator is very strict.
•  » » » » 3 years ago, # ^ |   +6 It's kind of you to answer my question~
•  » » 3 years ago, # ^ |   0 you need to print "\n" at the end of your input.
•  » » » 3 years ago, # ^ |   0 shold i use printf("\n") replace "puts("")" ?
•  » » » » 3 years ago, # ^ |   0 No, I said that before I saw your code... I think puts("") is fine.
•  » » 3 years ago, # ^ |   0 You have a trailing space at the end of the linesUse %d%c ... i == n - 1 ? '\n' : ' '
 » 3 years ago, # |   0 I think for prob C it will be more challenging if the input range is bigger, something like 0 <= n, m <= 5.10^9. with 10^5, even brute force implementation can pass. But, overall, nice contest!
•  » » 3 years ago, # ^ |   0 min(n,m,(n+m)/3) is not very challenging even 10^18. if this solution is correct...
•  » » » 3 years ago, # ^ |   0 I know, but at least brute force implementation will not pass (and maybe can gives more hacks.)
•  » » » » 3 years ago, # ^ |   0 let's wait system testing, and look at solutions 1500 score problem.)))
 » 3 years ago, # | ← Rev. 2 →   +11 This is so unfair. They skipped my solution to problem C. It was a super simple 10 line solution. How can it be skipped ? It may be due to coincidence that my solution is similar to someone else since it involved only 3 variables and simple commands!
 » 3 years ago, # |   +39 Erm... About problem A...
 » 3 years ago, # |   0 Thanks for very fast system testing!
•  » » 3 years ago, # ^ | ← Rev. 2 →   0 Let's hope for fast rating updates too :DUPD. It was very fast :) Thank you!
 » 3 years ago, # |   0 OMG!! I forgot to map[N]!!
 » 3 years ago, # |   +3 I don't understand why my submission is not any giving output. For the same case my solution is giving output in my codeblocks.
•  » » 3 years ago, # ^ |   +5 I don't understand it either. I submitted your code without any modifications and got AC 10086878Try to write admins about that.
 » 3 years ago, # |   +6 Editorial is published here
 » 3 years ago, # |   +4 There are a lot of people who unrated joined this contest. I think they are from DIV1... Not fair play
 » 3 years ago, # |   0 I don't have this efficiency in Div. 1 contests :( :-"
 » 3 years ago, # |   +1 Please explain problem D?
•  » » 3 years ago, # ^ |   0 Ok)) I am need too))
 » 3 years ago, # |   +3 Speed contest
 » 3 years ago, # |   +6 It's another swarm of unrated competitors...
 » 3 years ago, # |   0 Hello programmers! How I an quicly find general parent of two vertex on tree? For O(1) or O(logn) ?
•  » » 3 years ago, # ^ |   +1 LCA tutorial on topcoder.
•  » » » 3 years ago, # ^ |   0 thank you))
 » 3 years ago, # |   +20 Thank you all who participated in the contest! We enjoyed it. Hope you too :) I have written small blog post about what is like to be problemsetter: link. I will be happy, if this helps you to have a feeling of what is going on behind the scenes. See you in the next contests ;)
 » 3 years ago, # |   +27 Top 8 participants are unranked... Are you shi'in me?
 » 3 years ago, # | ← Rev. 2 →   +19 Seems like AkashiSeijuro used his Emperor's eye this time...
 » 3 years ago, # |   0 Nice!!! I became purple :P But I'm banging my head: stupid mistake on problem D, not using long long catch me again :(
•  » » 3 years ago, # ^ |   +2 say goodbye to int try typedef long long ll; and use ll everytime !
 » 3 years ago, # |   +20 How this submission passed system tests?Sum of all numbers in first array must be maximum 1e5 * 1e9 = 1e141e14 > 2^31-1
•  » » 3 years ago, # ^ |   0 It's the same as performing all operations modulo 2^32
•  » » » 3 years ago, # ^ | ← Rev. 3 →   0 How about this case: 3 1000000000 1000000000 147483648 1000000000 147483648 147483648 that code gives wrong answer. The variables needed to be long long.
•  » » » » 3 years ago, # ^ |   0 It gives Correct Answer!
•  » » » » » 3 years ago, # ^ |   0 Yes, you are right. Now I noticed, I made a mistake when testing that code.So sorry about that!
 » 3 years ago, # |   +3 http://codeforces.ru/contest/519/submission/10066478Hi Java fans. Don't forget that it's not right to compare Integers by ==. Use equals instead:)http://codeforces.ru/contest/519/submission/10085682
 » 3 years ago, # | ← Rev. 2 →   0 When I submitted my code, the verdict was AC. But when I open my submission page, the verdict has been WA.my source code is here -> http://codeforces.com/contest/519/submission/10067289Everything has changed after a few hours. What's the matter with test 6 ?
•  » » 3 years ago, # ^ |   +4 When you submit a solution during the contest, it's checked only on a small number of cases (pretests). Only after the contest ended, it's run on a larger number of cases (system tests). Your solution is incorrect because it considers only 4 rows of the chessboard. It passed pretests but failed system tests.
•  » » » 3 years ago, # ^ |   0 thanks for your help =))
 » 3 years ago, # | ← Rev. 2 →   0 Is there a tutorial for this contest? I can't find it. Somebody provides me with the link, please.
•  » » 3 years ago, # ^ |   +1
 » 3 years ago, # |   +6 all unrated guys have won,, u konw what i mean
•  » » 3 years ago, # ^ |   0 Did you have a seizure when you were writing the second half?
 » 3 years ago, # |   0 English Editorial please.Need editorial to 5th ques.
•  » » 3 years ago, # ^ |   0 just replace the ru in the url with com http://codeforces.com/blog/entry/16687
 » 3 years ago, # |   0 Thanks for this round. Finally become purple after 15 contests. :)
 » 3 years ago, # |   0 Really thank this round, I finally became blue!
•  » » 3 years ago, # ^ | ← Rev. 2 →   -10 But I lost 91 points!
 » 3 years ago, # |   0 Could not solve problem C just for missing the line "Furthermore, they agree that the total number of teams should be as much as possible." :( :(
•  » » 3 years ago, # ^ |   +5 I mean that is a pretty crucial line, it states the goal of the problem. If after reading a statement you do not know the goal of the problem you should reread statement. Overall I thought it was a very clear description of the problem.
•  » » » 3 years ago, # ^ |   0 Actually I misunderstood the problem. Thank you for the advice.
 » 3 years ago, # |   0 can someone please share the editorial link for this contest. I couldn't find any