Hi!
This Sunday will take place All-Russian olympiad for students of 5-8 grades, in the name of Keldysh. Good luck to all the participants! Olympiad is conducted under the guidance of the Moscow Olympiad Scientific Committee, in particular GlebsHP, ch_egor, Endagorion, vintage_Vlad_Makeev, Zlobober, meshanya, cdkrot, voidmax, grphil and, of course, Helen Andreeva.
We are happy to announce the Codeforces Round #657 (Vintage Codeforces Round #3) based on the problems of this olympiad! It will be a Div. 2 round, which will take place at Jul/19/2020 12:00 (Moscow time). You might have already participated in rounds based on the school olympiads, prepared by Moscow Olympiad Scientific Committee (rounds 327, 342, 345, 376, 401, 433, 441, 466, 469, 507, 516, 541, 545, 567, 583, 594, 622, 626) as well as vintage rounds (rounds 626 and 628).
The problems of this olympiad were prepared by DebNatkh, grphil, KiKoS, voidmax, I_love_myself, 300iq, isaf27 under the supervision of grphil.
Thanks ch_egor, vintage_Vlad_Makeev and meshanya for their help in organizing the Codeforces version of this contest and MikeMirzayanov for the Codeforces and Polygon.
Also I would like to thank the Tinkoff company and personally Tatyana TKolinkova Kolinkova for great help with organizing the competition.
Good luck!
UPD1: Scoring distribution: 500 — 750 — 1250 — 1500 — 2500 — (1500 + 1500)
UPD2: Editorial
UPD3: Winners!
Div. 2:
Div. 1 + Div. 2:
Number of problems?
[Deleted]
[Deleted]
Do not be so critical brother! Everyone is free to ask valid questions :-)
You can not call it back , until it finish !
Yeah.. until then lets hope for one! :-)
P.S. I don't understand why my comments are getting so much downvotes. I am only trying to maintain harmony. :-(
I am excited to see problems of Russian olympiad
Now after seeing them, u should be depressed.
yes I am depressed
.
[DELETED]
.
The last time I saw these many reds was when I witnessed an accident.
What are vintage rounds?
I think those rounds in which vintage_Vlad_Makeev is involved.
I don't know what's a vintage round,but it's definitely not a round in which vintage_Vlad_Makeev is involved . (This round for example)
Can I be BLUE....
not with the HARDEST div.2 ever.
Atleast for me it was the hardest.
No offence to anyone
So true!
Damn true. Even the school kids will solve till F and we would be struggling with C and D XD
Well I take offense
I wanted to hack Google Headquarters in my first semester.
Some big aim you had in your first year! Most desi Indians only think about hacking Facebook when starting in CS :P
And some opt cse only for this aim :)
Our education system needs improvement, If I would have started coding from my 5th grade then I think I would have been red coder till now, and I beleve its true for all Indians.
Nah ! If i ask a random 5th grade Indian student to start cp ,he/she would not be even be excited or motivated about it. Exceptions do exist but i am talking with respect to general population . I was more interested in playing football and cricket at that age .
but what they taught in schools can be changed to what we want to be taught depending upon your interests which will eventually help us in future
Even I was more interested in playing cricket, but I do wonder if I got introduced to CP I may have latched on to it because I had a good interest in maths and aptitude at that age and also CP has a gaming front to it with all the rankings and points, you just need a given the proper introduction and some good peers to compete with :)
True Indian education system sucks
we can only criticize our education system
Bangladeshi system sucks too. Atleast you guys have some pretty good universities
Yeah many of us feel the same, but no probs curently CP is rapidly evolving in India. India will have good number of GM's after a decade or so. And we need to create awareness about CP for a 5th grade student.
I remember learning paint in 5th grade in school lol
If coding from (5th grade -> today) = red coder then coding from (today -> today + 10 years) = red coder too. On top of that at this stage one will need much lesser time maybe 4-5 good years is enough.
The same happens in Peru, but with the 5th semester students. From the 1st to 4th semester they just use microsoft excel.
I wanted to code when I was a kid but didn't know where to start
Logged in, only to upvote you.
Our tradition is to memorize maths to pass exams.
Would gladly take this over 70 years of communism.
So hard to accept our education system
you can't blame it on education system ..... NO
If this contest was for 5-8 grade students, I feel like I am a new born baby.
This contest for 5-8 grade students and I couldn't solve any question. Seems like I dont know cp.
Can feel this bro :')
yeah ..it really true.Hope this will be change by our new education system.
Schools are like:
Taught in Class: Div2 A
Solved for practice: Div2 B
Homework: Div2 C
Exams: Div2 D,E,F
credits: adzo261
copied from Here ?
why is that unusual time ?
Because problems took from olympiad and for prevent leaking it, round will be in the same time as olympiad
tks :))
It is rated.ok
Is it rated?
me in 8th grader : tell my friend to open page 69th of biology book where there is a picture of penis anatomy
russians 8th grader : solve div2 problems
Refrain from posting objectionable words brother. :-)
Will the round be rated ch_egor? Asking because its not stated in the blog post:)
See the last word!!!
great !! we have 300iq now ... I am excited !!
Wow! Even einstein had 160. CF must be proud to have you guys :p
I've got 204.
I'm really surprised you don't have 420, that's not that far away.
"People who boasts about IQ are losers"
(f + f)iq = 204iq. It was just a joke :)
I would have upvoted you if you've said 255iq (ffiq)
Explain. I'm actually dumb.
ff in hex to decimal == 255
Now I see why I failed to solve even a single problem today.
same
m
That's a lot of red handles
Too many...
https://imgur.com/a/Awy9IQJ
Nice catch
Why are there so many down-voted comments in this blog?
(Notice the unusual timing)
I think people should think before voting because even the comments which are not at all negative are downvoted heavily.
I think people downvote it for fun...lol
which is wrong
Please do the contest later, in Central America it is 3 am
we will b enjoying this contest
This is 5 AM in America where I live
Considering the lockdown, does the time even mean anything anymore?
Yes, there's something called body clock, which when affected can cause various health problems
Hmmm Point
Score Distribution?
....
cook off bro!!!
....
Any reason why start time is 09:00 UTC, but not 09:05
Probably because it's going to be held in parallel with All-Russian olympiad. Also to avoid clash with Topcoder and Codechef rounds.
Hope the problem statements are clear and interesting xD
hey !
READ THE TITLE OF THE BLOG!
How many problems and Score Distribution?
Unfortunately, the last 6 months we have seen this instead of the exciting confrontation between tourist and MiracleFaFa :)
Nice!!!
Rating: users participated in recent 6 months
Since his last contest was on Feb 17, either he'll take part in another contest or disappear from the global rating in a month.
At least he's visiting the site which means he is still alive. :)
where's Vovuh ????? :-(
I am expecting a lot of math problems, hope that I am wrong
Never mind. :)
may be for your network problem
What's the Score Distribution? ch_egor
No Score Distribution and No. of Problems yet? ch_egor
where scoring distribution and number of problems will be published?? ch_egor
ch_egor ping
ch_egor ping
ch_egor ping
ch_egor ping
ch_egor ping
ch_egor ping
ch_egor ping
ch_egor ping
lmao. That is some ratism right there.
exit(0)
Sorry , no upvote for you
I like to think this was a game of Russian Roulette and this guy just got killed. RIP
everyone except him who replied had something to do with the round

tester/coordinator/psetter
There will be 5 problems
Noo !! It's 6 distinct problems :/ lier !!
Scoring distribution says it's gonna be SpeedForces.
You were totally right.
This aged well.
the first round during my summer vacation lol
I'm sure some people will join 5 minutes late thinking that round will start at 14:35 IST. :v
I am not able to find "register" button...
Is this Div1?
Seems so! Not able to TOUCH a question!!
I think we really need the help of pavan putra hanuman to solve the questions in this contest Xd.
There has been a small typo guys.. it is a Div 1 round..
one hand pushups were easier for me than this round's problems!
I've never seen such DIV 2 contest.
I guess this is what "vintage" rounds are :-P
Now I get why Russians dominate in competitive programming. :)
This is for 5th-8th grades?? OKK
I wasn't able to enter codeforces for almost 20 minutes. Anyone else facing the same issue?
Nope ,I didn't.
I entered code forces but couldn't think what to do for the past 40 minutes. Anyone facing this same issue??
lol
Good that you didnt enter brother! God saved you from a heart attack!
Yea me too
Should have rather rushed Bombsite B. On a serious note, is this really what 7th Grade Russians study? That is really impressive, no wonder Russians are such good coders.
Great div1 round!!!!!!!!!
2 minutes silence for all those who were too eager for the round to be rated.
expectation00 broh feelings...? :D
After walking through first 3 question:
How to unregister???
Will be waiting for this ninja technique
Same ..
OK now I'm looking forward to the editorial after the contest.
I'm feeling numb :( Is it a
Div.2
round orDiv.1
Round?Round by Red round for Red . Screaming Red.
Lul bruh, I have the exact same pattern of submissions, except I'll become specialist by today evening.
This is meant for students of grades 5-8? Wow.
worst div2 i ever seen !!
upd: I said worst cause its seems more div1 than div2 but named div2.
*Hardest
so more room to learn :P
is this round rated??
plz reply
I am proud that I have participated in Div 1 round.
I was getting 504 server error during first 20 minutes. I am feeling blessed.
Are you the lucky one?
I was having the same issue for a very long time. I think this happened with many people and not just a few of us. There were more than 15k people who registered and on the scoreboard there are only 8000 who have attempted a single problem.
I think this could have been because it was very early morning in the US, so lots registered but not many woke up that early.
You can always use these lightweight websites m1.codeforces.com m2.codeforces.com m3.codeforces.com in such trouble of server in my case these websites work almost everytime in a live contest.
glad to hear it wasn't only me xD
I was afraid I was the only one
feels like DIV1 to me
New technique to manage server load.
This is Div 1 :(
Are you trying to kill those poor 5-8 graders ?
They might have completed the problemset by now. Russian kids are seriously genious.
No wonder why tourist is so perfect.
is there any way to undo submission?
Ah, it was good that my connection was lost during the first 30 minutes.
Technique to manage server load :P
When you realize that this was actually a Div. 1 contest
Hell lot difficult contest!
Was this div 2? this was Div 1 ! Even more difficult , Div 0 maybe
div -2147483648
div MIN_LLONG
so true
I registered for the contest, I planned to participate in it, but I slept and couldn't wakeup on time. I was feeling bad but then i read the problems and number of submissions. Thank god, i didn't wake up on time! xD
You miss 100 percent of the shots you don't take.
why there is no extra registration?
so that no one else falls into this trap
this is my first ever contest....I havent even solved a single question
Don't worry, its my 21st, and even I couldn't solve a single problem.
Codeforces Round #657 (Div. 1, based on All-Russian olympiad in the name of Keldysh) [Rated] .. Looks better Now :)
Can I see how many problems those 5th-8th graders solved? Might be a motivation for me or myth buster for many!!
Sure you can! Check this!
How long was the real round?
4 hours, we had problems from B to F.
Before reading the comments I thought I don't deserve to be yellow on CF...

The the last four div2 contests (excluding the Global round):
654 — widely disliked
655 — good set but queueforces
91Edu — good set but major crash
657 — Mere mortals can't solve more than 2
(I agree I'm not of high enough calibre to say all of this but damn it a man needs to vent — I've been at 1750 for 10 contests and I couldn't solve a single one — damn pretests 2)
Try to concentrate more on developing problem solving skills than on rating.
Finally, I found you another expert, that did 0. And you have a much higher rating than me. I am sorry but I feel better now. ;_;
A hint : abacab*bacaba needs to Output "NO"
Woops, wrong person, sorry.
can u translate it for us who doesn't know the language?
What an insult it was :-D:-D
" really insulting "
couldn't solve a single problem :(
Russian 5-8 Grade students solving this... **Meanwhile Final Year graduates in India- I can Hack Facebook in 2 mins.
My son was in 8 grade, Now I don't have a son...
ROFL
So much implementation :(
Div 0 round
What is wrong with my A:87342260
1 11 abac???caba, answer should be no as they want "abacaba" exactly once
You are right, Thanks for the test. Does that mean that I just need to add some cases to my code? Or I will code another solution
What is the third testcase for C?
It's a record. First time 20k participant in div — 1 round.
Yet only 8000 dared to submit. Salute to those!
*F for those!
I submitted 12 times...wa on preset 2....
Exactly XD.
New technique to manage server Load
Haha! :D
Discovered by Anton and team
How to solve C?
We will only buy more than one flowers of only one type iterate to choose this and greedily take other flowers who have ai >= chosen bi
I tried to do like this but it hasn't worked(
I tried similar approach but couldn't get past test 5. What did you fix to pass that?
I didn't consider if no ai > chosen b
I did that too at the end, still failed :( Guess something is wrong with my implementation. Thanks.
Oh I found my mistake, I didn't handle this case: Number of Ai >= b is already >= n, in that case, I shouldn't take this b.
my idea was similar but I implemented it wrongly I guess. Thanks for replying.
I did the same and got WA2 T_T
Probably it was the hardest was the A ever
I don't see why is it rated for me when I'm clearly not a div1 participant
How the hell those russian kids are solving? I am feeling like idiot.
any hint for problem C !
you knew that you should take a[i] at least once to take b[i]. so, first sort all array A, then if we take a[i] once, then we have two options in the next step. take a[i + 1] or (b[i] for all remaining flowers), so think where you will know that you will take b[i] for all remaining flowers. i think this enough as hint. if u wanna more hint or there is anything ambiguous , tell me.
What's tc18 for F1?
It is kind of funny I visit the CF blogs comment section to see memes.
this contest is for grade 5 to 8,OMG i can only imagine level of Russian kids
Are you still a kid or it's just the old dp?
It wouldn't be a surprise if he actually turns out to be an 8th grader
no offence :P
Winning ICPC world finals in 6th and 7th grade :orz:
Problem A is not as easy as I though, it actually requires more implementation than usual :)
How to solve C? I tried a greedy strategy but it is not always optimal, and I believe fixing it would require m^2.
Why greedy is not always optimal?
I think it is something related to convex hull optimization technique.
I don't think so! I believe, greedy will work! Even though, I couldn't reach up to a correct solution.
Notice that you will only take b_i of one type in the entire process (if you could improve the answer by taking another b_k, you would just take all b_k as it would be better), and that it is optimal to take all a_j >= to this b_i before taking it and that you must take a_i before you can take b_i.
Now you can just iterate over b_i in descending order and do something like two pointer to keep track of the sum of a_j >= b_i taken while maintaining a used array to see if you've taken a_i already when taking b_i, so answer will be max of (asum till now + (n — a_taken) * b[i]), minus b[i] plus a[i] if we haven't used it yet.
I tried same thing. But, might have missed out something in the implementation! :(
Did you clear the used array? I got 2 WAs and wasted 10-15 mins thanks to that
Actually, I used 2 PQ's to implement this. Maybe, I missed something in the casework.
Ahh I see. I tried to implement it backwards (iterate over all a_i in descending order and find the best candidate for b, which I thought was O(1) since you can keep track of the max b already taken and not already taken, but the max is not always optimal. Nice solution!
It seems Div1 round for Div2 participants. Too Hard! ToT
Counter case for taking times modulo m / 2 (and ignoring hours), sorting and finding largest range with distance of max m / 2 — k using two pointer in D?
I kind of did the same thing. My solution was failing on this-
4 24 4 2
16 0
17 1
18 2
19 3
Try this
"Wrong answer on pretest 2"
5 words which summarize the contest
Seems like old codeforces rounds are back. Kudos to the author , Nice educational problemset. I hope more of such rounds which teaches how to solve real algorithmic problems in future, A B C were absolutely fabulous and not as per the score given to them , B is much more worthy than 1000 also. Again Thank You for such a brilliant round.<3
Yes true many people will complain about how bad the round was just because it was hard but the truth is it was really educational as even the implementation was hard and required debugging skills and the problems logic was also good.
Specialists are dumb
Please have a look at my graph before making assumption :P
yeaheverybody is crying but it was quite a challenging round and a nice change
Okay, Dear problemsetter,
No matter what you gonna say or not,you must agree on the fact that these problems was rarely similar to div-2 problem format.
Totally disappointed. I know I am not capable enough,but still I am gonna say,this contest was the hardest contest in recent time. It was not for div-2 at all.
Thank you.
No offense.
Should I register for next DIV2 round or not?
Never fear for ratings always assume that they are a sideffect of Leaninig. If losing rating hurts you then also its normal try not looking at standings during the contest and also not at all look at your colour, just believe that giving contest and one like this is making you a learn something new, everyday. and also training you on what you already have learnt. Especially do all those contests given in a list combined in the announcement above. These are some of nowadays rare contest problemsets and amazing. Once again do register and solve problems for fun.
My First Div 1 contest done !! -_-
This contest was harder than usual but problem were really interesting!
Can someone give a hint for D? Is it a ternary search?
can anyone tell me what is wrong in this solution?? https://ideone.com/rajqqD. This solution is for Acacius and String.
Buddy submissions won't be visible for 1st hour after the contest(check the announcement) better paste your formatted code here
updated the comment.
All these comments and the round is still running? seriously guys!!!
what?
I think people didn't have anything else to do.
OK I understand the problems were harder than usual ( and much more interesting :D ) but admins should shout down comments during the contest, what if someone talks about his solution for one of the problems!!!
How to solve B?
Nvm
Didn't understand the statement completely
You can't get 2 if l > 2
But what if l > 2, than a cannot be 2, because a >= l
but l is not always 2 so, we can not fix a = 2 always
My bad
I didn't read the problem statement carefully
No bro a , b , c must be in range [l,r]
Fix a and then try to find b, c.
did same still WA.
Actually you should check for both $$$rem = m$$$ % $$$a$$$ and $$$rem = (m + a - 1)$$$ % $$$a$$$
You have $$$n*a + b - c = m => n*a = m + x$$$ where $$$ x = c-b $$$ and $$$ m+x \in [-maxr+m,m+maxr]$$$ where $$$maxr = r-l$$$ Iterate over a and do a binary search over $$$n$$$ and check if $$$n*a \in [-maxr+m,m+maxr]$$$
So if you have $$$n$$$ and $$$a$$$ you can simply fix $$$b = l$$$ and calculate $$$c$$$.
No need for binary search, just find closest values to m you can get by taking positive amounts of a using division.
solved 0 questions but still a good round
Thanks for the great contest.
Too difficult for me...fighting!!!!
What is wrong in this code: Todays: B
For problem D, I think the hour value of trains wasn't necessary.
Was it supposed to be solved by iterating on all "minute" values of trains as a candidate of $$$t$$$ and then finding how many minute values intersect the range $$$[t-k+1, t-1]$$$?
Ofcourse, this will have few cases to consider like $$$k=1$$$ or $$$t<k$$$ but was this the overall idea for D?
is it just me?? the codeforces were saying "can't connect right now" by the time contest was starting and after 5 or so minutes later it started. I submitted my C problem solution before 2 minutes but it keeps loading and loading after the contest I checked whether it submitted or not. But it wasn't submitted?
People before contest were asking — how many problems? Meanwhile ch_egor to himself : Actually there are two problems.
How to solve C ? is there a greedy approach to it?
optimal flowers choice is to take some flowers only once, and then take one flower and put it to the rest of the slots in bouquet.
you have to iterate through that flower which is gonna be put to the rest of the slots and update the answer.
Can anyone from Russia covert 5-8 grades to the equivalent level of American or Indian Education system, or at least tell me students of what age group study in Grade 5-8 in Russia?
12-15 years old
13-15 y.o.
Problem B seems easier than Problem A.
it just seems so DDD:
I misread the contest as DIV-2 and registered it. I didn't knew it was DIV-1
why my B solution is wrong?
...
same w me :))
There are some cases that n*a have to be above m
In this case for example
7 8 13
the answer will be
7 7 8 , where n = 2 and 2 * 7 > 13
and the m%i method won't work for these cases.
try this test case if you are getting WA on pretest 2, problem A.
My code says "NO", and I was still getting WA on pretest 2
Try this test case for problem A
1
11
???????caba
ah this is the test case that got me... thank you