Hello Codeforces!
mesanu, flamestorm, MikeMirzayanov and I want to invite you to Codeforces Round #799 (Div. 4)! It starts on Jun/14/2022 17:35 (Moscow time).
The format of the event will be identical to Div. 3 rounds:
- 5-8 tasks;
- ICPC rules with a penalty of 10 minutes for an incorrect submission;
- 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
- after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
- by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).
We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.
Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the fourth division, you must:
- take part in at least five rated rounds (and solve at least one problem in each of them),
- do not have a point of 1400 or higher in the rating.
Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), then the round will be rated for you.
Many thanks to the testers: Neophiliatic, Qualified, sandry24, _Anurag, jampm, TimDee, Olympia, MoonKnight., AlperenT, BucketPotato and VIP-tester _Vanilla_.
And thanks to NEAR for supporting this round, details can be found in this post.
We suggest reading all of the problems and hope you will find them interesting!
Good Luck!
UPD: Editorial is posted!
As the tester I want to say
orz orz orz big great SlavicG thank you for dib4 div 4 div orz
time to get cyan
here
I have seen it even earlier than that
Copyright claim
All the best guys!
... Finally my First Unrated Contest xD
+1
I wait it
Good luck for Everyone
As a tester, get SlavicG to top 10 contributors by upvoting all of his blogs.
We made it :)
As a VIP-Tester, I can guarantee that nobody's life was endangered prior to me getting this role.
As a tester, I can guarantee that vanilla is beneficial for health.
As a VIP-Tester, I can guarantee that eating vanilla icecream will give you positive delta.
I love div.4 rounds. Good luck for everyone who less than 1400**!
You talk more than you do
Damn bro that's actually rude
Who told you I don't work hard every day !? I am a student in grade 8 so most of time is gone in studying! I have no time to code every time, but I do all my best to become a specialist.
Continue your journey and don't care about people's (bad) minds.
Thank you
Nailed it! XDXD
keep working with time you will get better
Good luck for everyone
Thankyou to all the testers and problem setters, and good luck to everyone
Another Div-4 Round, thank you! I love these kind of problems!
Good luck in lightspeedforces round
If anyone knows the real name of Lemon Sunomono tell pls.
Last 2-3 contests were so difficult, I hope I do good in this one and get back to green.
I look forward to give my first contest in Java, which I learned recently :)
my first contest me as a unrated participant :)
same :)))
This is my first contest as an unrated participant...Good luck everyone!!
Does anyone here use CP Editor to run, compile and directly submit their codes in cf contests?
Prepare for the memes about specialists being unrated :/
Thank you sir for organizing div 4 contest.I always love div 4 problems.I think all beginners also love div 4 problems.
If someone is currently Specialist and is going to become Pupil after the end of Educational Round 130, should they register now and be *out of competetion, or wait for delta change and then register in competetion ?
wait for delta change and then register in competition, because maybe you'll get positive delta in this round.
Thanks for the motivation.
But I'll need a stenographer for fast typing. xD
First unrated round for me, feels good!
Hope for the +ve delta in this round!!
What happens if someone is pupil and becomes specialist in the previous round but registers for this round as a pupil, will the contest be rated for them?
No
Nah, i am mistaken
GOOD LUCK EVERYONE:) HOPE I'll able to solve 2+ problem in this contest;)
If I cannot make to specialist tomorrow, I will shave my head.
Then prepare your razor...... . . . . . . . just kidding
All the best
Post it if it happens
please post, I'm dying to see this
adding you to see your performance
Sorry everyone, I have done my best, it's midnight here, I felt my head is going to explode:( Still can't tackle H, why am I always missing a problem to AK a Div.4 Round? Maybe I can't reach cyan, I will post the pic later:)
you definitely reached cyan. Good job!
Wow, I can't believe it, thanks!
btw now I have to consider how to not drop from cyan:)
you made it! well done
All the best everyone!
What approximate rank will I be needing in Div4 to get +120 Delta if my current rating is 1280 and I have given only 5 contests before?
First unrated contest for me.
My first unrate contest OwO
P.S. Good luck for everyone.
I'll be a specialist, when they will give a rating for Educational Codeforces Round 130 (Rated for Div. 2)
You sure? System testing for that round isn't done yet and your solution for C is O(n^2) imo, so your solution might TLE. P.S.- I hope you pass though :)
thank you for your hope :)
_Anurag orz
_Anurag orz
_Anurag orz
_Anurag orz
_Anurag orz
_Anurag orz
_Anurag orz
_Anurag orz
_Anurag orz
_Anurag orz
It's a good rules and good job. Thanks for you
I wanted to add VIP tester _Vanilla_ as a friend, but he is currently a friend of 69 users.... so I'll let it be for now
Wise decision, breaking such balance would bring chaos upon our universe.
UPD: It seems like someone has already done it. The legend says he will have negative delta for the rest of his life.
well now that it's already at 71, let's just try to get it to 420!
(RIP @ whoever got cursed for breaking the balance)
contest on my birthday, hopefully i don't lose rating lol
Happy birthday! Our birthday is in same day :))
Thanks man, same to you :)
I think the time to be Pupil is come Insha'Allah hope to a good contest
Thoughts on the takeover?
Good luck everyone , hope this would be a fun and interesting round to be participated in.
leetcode monthly contest?
lol
Actually some leetcode contests are harder than this.
Best of luck to everyone!
Is it possible to move up to a specialist from this contest?
yes
thanks for answer
The contestant plays the role of red coder by solving 7/8 problems in div-4

As a newbie coder, I love Div 4 problems.
My first unrated round :)
first contest as an unrated participant
GOOD LUCK TO EVERYONE!
Div 4 contests are more frequent nowadays, NICE.
Hooray for div 4, I can at least do the task, otherwise it's difficult to solve div 2 or div 3.Good luck to everyone . All testers and the author of the Olympiad div 4, thank you.**__**
"take part in at least five rated rounds (and solve at least one problem in each of them)"
Is it some new feature? I can't remember the same thing being about a year before. Especially because my rating has been changing since my first rated contest.
Actually this rule is for only div3 and div4 rounds. If anyone participate his/her first contest other than div3/div4 then the round is rated for him/her.
Good Luck Every one;
What are the hacks? What can participants do? Sorry, maybe dumb question, but I am first time here
You can view other people's solutions and find a test case that makes their code fail, that's hacking
Thanks a lot! Now it is clear
Wlc
As a tester, I can assure you this is going to be one of the best div4 round till now, congrats to the problem-setters for the great problems, and I wish yall good luck!
So are D4 contests just speed games? I'm slow.
Will Try to Finish it under 40 min. Previous record is 50 min. Let's see if we can break it Today!!
Well seems like it wasn't speed forces after all.
I really loved problem H.
Yeah i came late and got stuck on H because i am a retard clown whose always do the silly mistake everytime. i liked problem H i have solved this type of problems before a lot. So for me i was doing nothing new as implementing what i implemented before.
Hopefully I get to candidate master after this round! very excited
First unrate contest, lol
Does anyone have a problem with the dollar sign in problem page all brackets sees like $ sign.
yes.
Hi MikeMirzayanov. Please fix this dollar sign bug before the contest.
It's a browser issue. Please update your browser.
Problem is fixed.
Best of luck to everyone
Hope every want to be Specialist can be Specialist.
div4 is more likely speedforces. all the best everyone
All the best!
Difficulty:
Once again, if you are not sure, I will say as tester — this round is really fire, it's one of the best quality rounds of last months, and best div4 I ever took part in. I suggest everyone reading all problems (even Blue-Purple-Yellow-Red participants). Good luck and have fun writing this contest.
Yes, it was fire for sure
First unrated round! I believe that I can enjoy myself as well as the problems this time.
GL; HF!
First unrated :D
hopefully, I will motivate again for this contest. thank you for arranging div4 for the newbie
Downvoted. DIV4 SHOULD DISAPPEAR!
Why?
just dont participate man, it doesnt affect you
i am going to participate at 1399 rating points. xD
2 hours 15 minutes sounds like a slightly harder round... interesting.
Just for my curiosity, was it really harder in your opinion? When I tested problem H seemed very respectable :D
Not hard in my opinion but interesting, i will solve the unsolved ones for sure.
Yeah, feels like H was around 1600-1700 rated in terms of implementation and apart from that I really liked how creative D and F problem were.
This time it was a different Div. 4 round :)
Good luck everyone!
Can I register lately?
Rip cfsubmit didn't work properly for me when submitting to problem C, costing me 4th place :(
Nevertheless, I clutched 6th place with a meme screencast: https://www.youtube.com/watch?v=Aw_U6cnUh-0&ab_channel=JoshuaChen
Very educational contest! This is the type of Div 4s that enjoy participating in.
the last problem is very nice, kudos to the author
Nice H..
what's nice about it?
Nice contest! For those who are interested, my screencast and solution explanations to all problems will be available at https://www.youtube.com/secondthread as soon as the contest is over.
Subscribers count through the roof!
Can you do this for more rounds that you participate in?
nice round, F is interesting
Guess it's just me, but this time are problems too hard for DIV. 4 can't even sort out 2nd problem last DIV4 I solved almost 3 problems.
take your time and really apply yourself and try to upsolve as much problems as possible. It helps alot. Also look at the solution for all the problems, even for the ones you have solved, it might give you insights you hadn't thought about.
Enjoyed the round. Thanks to the problem authors! :)
Awesome contest, Nice set of problems !! Thanks to the authors <3
I choked F lol. I missed $$$7 + 7 + 9$$$. Cost me 3 penalties...
Nice Contest, second problem was a bit tricky rest all were good!
H was nice
I was trying to solve the E problem with 2 pointers by making an array of indices where there are 1's and calculating the difference and moving accordingly. Was I correct ??
Yes, this will work, but a simpler approach is to calculate maximum length subarray with sum s .
here I found a code very similar to mine from the standings
https://codeforces.com/contest/1692/submission/160577679
it get passed and mine gets fail
I believe that you are checking the i=j=k condition late. You initially check (i==j) and it holds and you do not check (i=j=k) and move on, and return "NO", but the answer could have been "YES". You should try putting that else if (i==j && j==k && k==i) at the top.
Ya just get to know this, feeling very frustrated
can someone tell me what am i doing wrong here for question F
https://codeforces.com/contest/1692/submission/160638148
First, explain your logic, and then I'll check it.
sorry for downvoting its pressed by mistake
here I first make frequency array of remainder than I go to each case such that on adding it gives either 3 or 13 or 23 than i check if it is possible by checking their frequencies
The approach is right,just move case(x==y && y==z) to the first place because it will never execute when x=y or y=z or x=z;
thanks bro
this mistake gonna lead me back to newbie
I believe that this was the perfect div. 4 round! Problems were educational and of perfect difficulty.
I get 4000-5000 ranks in div2 and 12000 in div4 feels like hell:°(
Can someone please tell me what's wrong with my two pointers solution for problem E? 160627514
Explain your logic and variable names first, and then I'll check it.
thanks bro. "i" stands for pointers from the begin, and "j" for the end. Bufa is the number of 0 from the begin while bufb is from the end. The two pointers would increment 1 generally. In the meantime, one would check wether the other pointer can get a 1 with lower 0 counts.
Try in this test case .
it's two. correct
now this
bro you are awesome.
It's 3Sum not Threesome
loved problem F. not because of the problem, but because of the name ;)
cannot access editorial its redirecting to previous path
cf definitely hates me, just because i put 3 instead of 4 got WA on test 1 (the WA on 8 was because of l)
i would've got specialist :/
bro if your code will fail test cases then you will only get WA nothing like hates or something.
Congratulations to authors for problem H!Very interesting!
What is wrong about my code of Problem C
I think the separation of and is the issue, but a little tip: just dont use if() rather than hold v[i][j] and compare this to all 4 indexes you are comparing with. Makes it a bit easy to me to not get confused. I hope it helped you. Edit: Ya, Now i saw that use of '=' instead of '=='.
On line 19 in your code, within the if condition, you are using assignment (=) instead of comparison (==)
Here's the AC version
if(ans[i][j]='#'), should be ==. You can even remove that if.
I think you've made a mistake on line 19 in your code, whilst writing the if condition.
assigment is (=). comparison is (==).
You have used the assigment operator instead of the comparison operator.
helping for beggenier
i loved this contest ( except for d) hope i can reach pupil again
I have a wrong submission for first test, will that be counted as a panelty l.
nice problems but a bit hard for div.4
why map gave tle in b?
nope, i did that with map. Looks like you are checking 10000 times for 1000 test cases, note that here sum of n is not bounded.... So your solution likely went over 10^6 computations hence the TLE. You should instead iterate over the input array.
If the size of map is n,each times,the time of useing map[i] is log(n). I see your code,even the map[i] is 0,u search it.This need log(n) to modify the map and log(n) to query. I advise u to use for(auto it:'map's name') to query each in map.That will avoid insert and modify the map[i] that == 0. What's more u only need to know the number of the kind.So set would be a better choice. The ans is the size of the set.And if (n — ans) is odd,u have to ans--,since u can only remove two numbers each op. Here is my submission that use set to slove:160536879
Hello people,
I couldn't figure out what's wrong with my code for problem C. I would appreciate any guidance,help, answer or hint in order for me to correct it.
https://codeforces.com/contest/1692/submission/160649178
think what happens when the answer is "NO"
I think that the input() in python also reads blank lines, so when you try to iterate from 0 to 7 produces runtime error. Also in your answer you don't put an space between str(outputs[k][0]) and str(outputs[k][1]). But the logic is perfect, it's simpler than what I did.
Hello, thank you for your response
I just update my code according to my understanding of your idea added another input line for blank line (it has been said that input cases should be seperated by a blank line) but I'm still having the same issue. Could you propose an adjustment to it please.
https://codeforces.com/contest/1692/submission/160663411
In the case of:
The program will fail in the second line, because when you do
array_elements = [array_elements[i] for i in range(0,8)]
you will have an out-of-bounds error, becauselen(array_elements)
is zero.So we want to ignore empty lines, no matter the position, for this I simply add a while loop:
I don't believe this is the adecuate method because I don't program in python, but it solves you error
Hello,
Firsty I would like to thank you for you effort. Your solution worked fine. The problem was that the issue you mentionned with "array_elements = input()" that could capture a blank line is literally non existant when running the code locally. Locally array_elements captures the right string which ".....#.." (for example) and when printing len(array_elements) I get 8. In brief, I couldn't reproduce that error locally so there was no way I could figure it out all alone. Thanks again for your help
You can take a look at my solution to C. I also ran into the blank line issue mentioned below and this should be a working fix.
https://codeforces.com/contest/1692/submission/160574335
I have a scanner class for reading input and output, which might prove useful to you. I haven't tested its speed yet, but it seemed to be good enough for this contest.
Of course the while loop should also be added to Scanner.read_line() as well. For this see:
https://codeforces.com/contest/1692/submission/160679009 (ignore the fact that it is hacked LOL)
I tried to hack a submission of H, but the judge returned 'Unexpected verdict'. is it my hack's failure ? or judge's?
There are some
Unexpected verdict
in the Hacks of problem H.This blog said that it's because one of the solutions marked on Polygon as Correct can't pass the hack data.
Please fix the problem.
it's happen to me also .
I'm curious why it's rated for everyone rated less than 1400 whether or not they are a trusted partipant? Someone rated >= 1400 can create a new account just before the contest and ruin the ratings of Trusted participants right? SlavicG mesanu flamestorm MikeMirzayanov
No. The contest is rated for everyone less than 1400 but only official participants are considered while deciding the actual delta. So new accounts won't have any effect
Then how will the delta for non-trusted participants be calculated?
This is a necessary fact. Reform This problematic method Proposal High self-ability
If I'm not wrong, all new accounts have a 1400 hidden rating at the start. For the first 5 or 6 rounds, you are gaining additional rating points which sum is equal to 1400 (that's why you can solve 0 problems but receive something like 357rating) + normal rating delta for the account that started with 1400 points.
No, not anymore! These days new users start with a rating of 0 and not 1400.
How does Hack system works in Div 4 Rounds?
If someone for which round is rated get hacked for a particular problem will it also reflects on their ranking while deciding the standing or rating?
vanila orz, vanila solve gadfadar
Problem H was a nightmare for unordered map users. Also idk why a lot of python users are getting hacked in this problem.
And I was thinking I would reach specialist after this round.
Is it possible to see what test cases people are hacking with? A lot of python solutions for H are getting hacked and I would like to test mine against these hacks.
If anyone would like to hack my submission here it is: https://codeforces.com/contest/1692/submission/160678189
Edit: Thank you beethoven97! Could you weigh in on the method of your hack? Are you exploiting the dictionary's hashing method?
Amazing round, my first time solving all problems,even though the last one only after the contest. Great feeling!!
What is the case of 73 of test 2? Not accepted, someone help me please. 160678922
Explain your logic and variable names
In H, will finding optimal subarray length for every distinct gives TLE? If not then why? If yes, then how to solve it?
Really good contest, thank you to all authors and testers. Problem F was quite interesting and H seems to be a good problem, I haven't solved it yet tho
How come O(N) time solutions of Problem H using map in python give TLE and get hacked ?
Understood the method, found out about Kadane's algorithm!
Why doesn’t the rating change for me?
Can anyone please point out the error in my code/logic (Problem G). I used a sliding window approach by making a window of size k. The variable bad used in my code tells the last index till the current index where the inequality does not hold.
My submission
https://codeforces.com/contest/1692/submission/160622089
You can try this case:
Answer is 4 but your solution output 6.
I found that you will break after finding the bad position for the first time, which causes if there are multiple bads in the length of k, you will only find the first one
Now I changed your code :
And Accept 160742816.
It's a good idea, just didn't notice the details
Ah got it.. thank you very much :)
Is there any indication of whether the regrade has happened yet?
When will rating updated?
No idea((
even I am waiting... Hacking phase has ended way back :(
Why did the round go unrated ?
why would you say that? nothing was announced yet
It is rated. The same thing happened last week it showed unrated and then the rating came up, they took a little time to update.
Excuse my question, but how does a contest show up as unrated?
How do you know?
Same thing happened in round#797 .It was showing up unrated at first. If im not wrong , ratings will show up within an hour or a two.
system test not done yet, still more to wait
Still not rated?
MikeMirzayanov
Legends are still waiting for rating changes :)
I think this is the longest time I waited for rating change
are you expecting a colour change?
Intially I expected that I'll be Cyan for my rank and number of participants but realised It doesn't happen in Div4 and now you are seeding doubt for even green colour change
even I am waiting for my color change. But now it seems like this competition was maybe unrated. IDK though
The competition won't be unrated unless the team officially announces it. So currently, it is rated. As it involved a 12-hour open hacking phase, there may be some delay in reflecting the rating changes.
I see. But its been almost 12 hours since the hacking phase ended.
Congrats for your Color Change :)
Thanks a lot Aravind! Congrats to you too!!!
if you want to learn to type fast https://data.typeracer.com/pit/home is right for you
Rated
Any idea when rating will be updated??
unrated
Looks like this competition was maybe unrated
I also think its unrated.
https://codeforces.com/blog/entry/103654
no
I have not done any cheating in the contest. It is a simple coincidence. I don't even know the person with whom I am caught. Please look into the matter again. I didn't violate any rules. Please consider my submissions and give respective ratings. [contest: Codeforces Round #799 (Div. 4)] 1692D - The Clock 160638839 pratham0703
Rating changes when sad noises
I don't know why my solution is said to be matching with others if there I have my unique method of solving that question and some others solve that question by that particular method it doesn't mean that it was copied, as many questions have many methods to solve. This is unfair.
it is a coincidence that my solution is matching form the other solution mentioned in mail by system. Also I had done my code by my own. My solution of question A of contest 799 is matching with many other because it is simple one and it has a simple method and everyone followed that ,this does not mean that I have copied from other. So I request you to give my rating back.
Finally Green
using unordered_map:https://codeforces.com/contest/1692/submission/160690124 using map:https://codeforces.com/contest/1692/submission/160753527 using gp_hash_table:https://codeforces.com/contest/1692/submission/160753661
i
Is it possible that a person less rated than other one and has got more rank in the contest than the other one, after rating change become more rated than other one??
Yes, if that contest of more ranked participant is still less than or equal to 6
Div4 contests are so easy.