Hello Codeforces!
I am delighted to invite you to the first Div. 4 round of the year: Codeforces Round 1074 (Div. 4)! The round is scheduled for Jan/18/2026 17:35 (Moscow time). You will be given 7 — 8 problems to solve (all authored by me), and 2 hours and 15 minutes to solve them.
The format of the event will be identical to Div. 3 rounds:
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 will be recalculated.
Only trusted participants of the fourth division will be shown in the official standings. To be a trusted participant, you must:
have participated in at least 5 rated rounds where you have solved at least one problem.
have a rating less than 1400.
Regardless of if you are a trusted participant or not, this round will be rated for you if you
have a rating of less than 1400 or are unrated.
do not select the "Register as unrated" option when registering for the contest.
Participants who are rated 1400+ are not allowed to create a new account for the purpose of competing officially. We encourage you to take part unofficially.
We would like to remind all participants about the rule against using artificial intelligence tools during the contest. Violators will be sent to cry's basement; we spent a long time expanding it so we could host this round, and we sincerely hope that it won't be filled back up again.
I would like to thank:
cry for being an incredible coordinator, and for giving me a chance to write this contest.
Vladosiya for translating the problems into Russian.
cduckling for looking over the initial problemset before I officially proposed it.
Our red testers: __baozii__, Intellegent
Our golden testers: Arpa, -firefly-, AksLolCoding, Edeeva, Friedrich, omsincoconut, Proof_by_QED, temporary1
Our purple testers: macaquedev, pop, tin.le2, wuhudsm
Our blue testers: apollo07, Argentum47, Eikyu, Ermiooo159, expertaq, Jteh, ritam1234, simplelife, SpyrosAliv, susvent, Vladosiya
Our cyan tester: anandswaroop191
Our gray testers: DraxLab, piman51277
Our unrated tester: qdread
MikeMirzayanov for creating Codeforces, Polygon, and testlib.h.
You, for participating!
I wish you all the best of luck in this competition, and I hope you enjoy the problems!









Auto comment: topic has been updated by nik_exists (previous revision, new revision, compare).
As a tester this contest is peak !!!
As a tester this contest IS peak !!!
I concur
Is it a google sponsored contest , asking for a friend ^-^
I think so :)
It is a Codeforces sponsored contest, Yellow-Blue-Red
As a tester, uwu another div4
As a tester, :thumbsup:
W div4, good luck everyone!
As a tester, I tested.
YES. GO __baozii__
My first time unrated :(, a sad feeling, but also a happy feeling
hope by next div4 , to be unrated
Why does the coloring remind me of mod-3 problems?
Yellow Blue Red
It reminds me of Codeforces
as a tester, the tested problems were untested by testers because testers tested the tested problems and tested the untested problems because the tested problems were untested by the testers who tested the tested problems.
Good tongue twister
Good tongue tester
as a tester, -firefly- orz
Finally, we don't have 6-7 problems in a CF Round. I think this comment worked :))
Why rounds announcements only appear in my dashboard after 5 days??
I wrote the announcement as a draft 5 days ago, and it also took time after publishing the post for it to be on the dashboard, since there was the Div1+2 today and my post couldn't be on the homepage as it would be above the other round (or below, and neither scenario is good :|)
makes sense
let`s go !
I hope one day I also will be unrated for div4 and it will be soon!
Hopefully the evaluation process will be quick.
yay a div4!
red testers in div4?
Do we not have score distributions in a div 4?
Div 4s (along with Div 3s) use ICPC style scoring, so there's no score distribution; rather, your ranking is based on # of problems solved, and penalty is used as the tiebreaker.
Got it thanks!
Very first contest after becoming expert
Hey guys, check out my channel, I'll do a video after the contest sharing my solutions about the problems.
hacks do not give additional points, but does failed hacks reduce points line div 2s?
no
yes , actually $$$-50$$$ for each non-successful hack (in non educational rounds , i.e. regular Div1's,Div'2s and combined).
lol i have 1392 rating, just below the 1400 limit
same
First and probably last contest of the year for me
queue is bigger than in the mcdonald`s on Time Square
Hey am I the only one facing problem with this contest loading slowly and not working properly
queue be slower than mcdonald's wifi
Isn't it obvious ? This is Div4 and the setter would make much much easier (probably no-brainer) A and B thus leading to more submissions. I guess most of the contestants are habitual of that now.
oh, sorry im new here lol
not really, all the questions up to F for me are slow in queue. not because of overloaded submissions
Screencast will be available after the contest!
The sneaky line in E to catch cheaters!!
nice
which line?
ha everyone is using damn chatGPT, sooo depressing
I'm happy to participate my first contest,
unfortunately I got rte on Problem D because my input buffer size wasn't big enough.
and yet another rte on Problem E, not sure what caused it, looking forward to learn on my mistake.
i got d but e is impossible for me.... i thought of maybe pushing spike positions and robot positions after each instruction but thats way too slow... looking forward to the editorial :)
One hint I can give is, Try with the distances for every robot. Like maintain left and right distances from robot to the spikes left and right, and try iterating on the direction string and maintain a currpos var, update if it is 'L' currpos-- and else currpos++. If currpos is < 0 then try to erase the values of left and viceversa.
this was the most fun cool interesting div 4 in my entire 5 years of existence, thank you for birthing such joy into my life.
super glad to hear that!
E was really cool. Njoyed whole contest.
bro, can you give me some suggestion or advice I am struggling
https://codeforces.me/blog/entry/150087?#comment-1340895
Hint for E?
Each of the robot will be between 2 spikes (the other spikes don't matter for this robot), we could sort the spikes and do binary search to figure out which 2 spikes surround this robot. Using those 2 spikes we can get the maximum distance the robot can go to left/right without dying. To figure out the minimum number of moves it takes to die we would have to do another binary search on the minPrefix/maxPrefix of the string.
super happy to hear that!
btw, good thing came across my mind, how can I be a tester?
F is one of my favorite problem from those I've solved recently. I feel like it sets up a really good intuition for general segment tree logic, which I've been pushing off learning properly for a while now.
You can do it without segtree.
but vibe is similar :)
Intended is actually prefix sum, but almost everyone used segtree :|
I thought intended was binary lifting
Awesome problems, thanks to authors!!
tysm!
E and F were nice :)
hmmm a lot of participants stores the instructions in a variable named
gdCodeI never knew there were that many geometry dash fans in codeforces :o
Example? I clicked a few and didn't see it.
ohhh geometry dash
I believe SpaceUK fans participated.
How to solve H in better than $$$O(n \log^2{n} \log{10^9})$$$? I just implemented the first bullshit idea that came to mind and it magically passed (probably very easily hackable though).
My solution is $$$n(logn+log10^9)$$$.
358614501
How come the hacking round hasn't started?
Since CF doesn't like me dming people for some reason, if you got unexpected verdict on your hack, please resubmit the hack, I've removed the offending solution.
is the hacking round currently active? All I see is system testing and hacks unavailable.
Hacking should currently be working
I saw that hacking was available then it disappeared shortly after.
it's probably just cf being weird
When you go to common standings, you see the timer ticking down on the hacking round?
my apologies, i made a mistake. It should hopefully start soon.
What was the mistake?
I mean I made the mistake of thinking the hacking round had started.
Ok, my bad, turns out the hacking phase had already started, I thought it showed on the contest page but you had to go to standings to see it. Have fun hacking!
nik_exists
The hacking has disappeared again.
While the end time was 7:35 AM Moscow time
It still shows that we have a couple of hours until hacking is over on my end. Make sure you're looking at standings and not the contest page.
??
That's ... interesting, neither me nor my coordinator know what's going on, and sadly, Mike and Vladosiya are probably sleeping, so we won't be able to ask them. Does it still let you hack on your end?
UPD: It is now fixed.
Thanks
I am getting TLE in D...Any suggestions? (I was copying the array after failure)
copying the array will give you o(n) again so total complexity gets to o(n^2)
easy ahh questions, nice tho
It's a div4, the questions are meant to be on the easier side. With that being said, I see many people saying that they find the problems more difficult as well, it differs between people. I'm glad you found the problems nice though!
Is there a problem in cf, it is still showing system testing 100%.
I had this happen to me. Figured out it was tied to my IP. Had to use hotspot on my phone to get around it. Was glad to get a bunch of hacks in to improve the final test quality before my crawling ban arrived.
That was interesting, my phone hotspot stopped working but my laptop started working...
hi everyone!
i’ve observed some weird things related to this contest.
would love if the above two issues can be addressed and looked into, other than that, great contest and a nice problemset!
I have no idea what's up with the first issue, i'll bring it up with my coordinator to see what's happening.
The second problem is due to Codeforces being weird, you should be able to still hack anyways.
turns out if you have a peak of 1600+, you aren't "trusted" for div. 4
:floshed: damn i didn’t know that :o anyways thanks to both of you for helping!
why im unable to submit problem?? still showing system testing!
Right now, it is showing system testing for hours. This solution is stuck in getting the verdict "Running on test 2". Anyone have the same issue or is it just me?
Update: It has been fixed now.
A good contest, all the problems before G were very suitable for Div.4 and were really cool. However, I spent quite a long time thinking about problem G and still couldn’t come up with a complete approach. I could only guess that it might involve binary search combined with some data structure ?
Clarification regarding the official standings:
In Div. 4 rounds, only trusted participants are displayed in the official standings. Participants who don’t meet the trusted criteria may not be shown, but the round can still be rated for them provided their current rating is below 1400 (or they are unrated) and they registered as rated.
I passed problems A, B, and C, but I cannot find the option to submit a hack. Why is that?
If you go a submission, eg https://codeforces.me/contest/2185/submission/358469812 , there's a button that says Hack It! that you can press to hack a submission
Oh,I knew it.This is a problem regarding IP.I solved it with my phone hotspot at the time.
Wait, are you actually still hacking with Python hash collisions? That is so cringe. Just stop, it's pathetic.
It’s complaints like these that keep me going. ;)
Ouch got you on problem D as well.
Can someone tell Cry his basement just got famous again? Great round, really enjoyed it!
all the skipped submissions will soon be receiving a message containing a one-way plane ticket to cry's basement :).
Glad you enjoyed the round!
Does cry's basement contain Geometry Dash.
well, we'd have to include it, since it seems like there's a lot of geometry dash fans in this contest :)
Rank 54 to 74 or so on current standings looks very suspicious. They all passed cheating review?
The problem H is too tricky.
i appeared in my 1st contest this time i even solved 1st problem but my rating is still 0 even after 12 hours of completion of contest and contest is showing under unrated section can anyone tell y ?
I think it is an issue in codeforces, recently one of the submits was stuck in test 2, it has been fixed already, i think there is another bug, or there are lots of participants so the server is struggling. Be paitent, we are waiting for our rating too!
is it rated?if yes,when will the change in rating reflect?
It looks like you are new to Codeforces ratings usually gets announced within one day
As a non tester I didn't tested
Man what a good use of hidden text in problem "Robotic rush." Today while checking it out I saw the easter eggs for cheaters. This is really needed for those ai cheater. Hope some actions are taken against those who Solved THE ROBOTIC RUSH using ... lets just say upto there :)
i agree... i think they should do some other nifty things like this for the cheaters... so many people used gdCode on this problem's submissions lol
Amazing contest. Really great problems, thought I should've solved D and E now that I've seen the editorial.
Till when will the ratings be updated?
+1
+2
Has system test even started?
we gonna get gta 6 before rating changes
i think they are sorting out the cheaters in cry's basement first
Except H no question tested anything except fast implementation,poor contest imho
Is Test 14 for the Robotic problem a test from hacks? In normal tests I've passed, I also solved the problem in basically O(n)* hashing time for unordered set and unordered map. But, just now I saw I'm getting TLE. This is the solution, the tutorial is also similar I believe, what I've missed? Did multiple calling the hashsets caused the issue? If that's the case, then isn't unfair to design such test cases/question in div 4? Can anyone help to find the bottleneck in this solution? Maybe I shouldn't have used long long? Don't really know what's the issue. I could have stopped double checking if a certain position is already cleared, but in fact it shouldn't be a matter since it is an O(n) algorithm. The only bottleneck comes in my mind is that, but even that should be fine (eg a test case that always goes left and right and kills everything after the first move, but it should be fine, multiple useless calls to a map, but it is amortized O(1)).
Update: Thanks to all left comments and suggested changes. I had to use map and set instead of unordered_map and unordered_set, I've changed that it worked. I believe these kind of tests, in any level makes no sense, not just for div4, even for div1, it is just to know how things work in codeforces, it is not about problem solving, finding better programming tricks or anything positive. I believe competitive programming should not stress on such nonsenses.
Don't use unordered map rather use normal map in codeforces.
If that's the issue, then it is a really bad question for this level, I hope it is something more than tricks in codeforce, otherwise unordered_map is better in most cases, it doesn't add log n extra barrier, but could have many collisions with a very low probability, then if someone tries to test collisions for such a problem, it is not a good effort to not put it in original tests. I hope it is not the case, otherwise it is sad.
I used map though still got tle at tc15. They expected us to use vectors not maps.
And yeah its pretty frustrating because on paper it looks like it will pass, maybe I am wrong but I thought about it for a while and I think the error is marginal.
No, map should not give TLE. I used map too check my solution. Also its pretty famous on codeforces to not use unordered_map as its always hacked.
My solution uses a map, and it works. The issue with your code is that it repeatedly tries to kill robots even when they are already dead. If you were to clear left[pos] and right[pos] after iterating once through it, you would get AC.
My apologies for this not being in main tests, I didn't think of this edge case.
Yep that could be the issue. I should have cleared it once the robot was dead I realise it now. Nice catch!!
My solution got a TLE after the rejudge as well 358577411 :(
Sad, I had a good ranking, I solved this quickly and had a lot of time to solve another problem or fix existing ones, didn't want to solve any other problem and didn't think there could be a wrong asnwer or TLE for this as it was very straightforward. Closed the laptop and now checked it, it is TLE :/
Got TLE on E during system testing — wtf I was actually happy this time because I felt I performed at my full potential, and then this happened.
Ah well… God’s plan, baby. On to the next one.
It looks like you got TLE due to unordered_map usage. Either use a custom hash or just use the normal map instead.
I used map not unordered map
mb, I was looking at the wrong submission, I commented earlier what your mistake was.
That being said, please don't include the code to previous problems in your submission for another problem, since people can look at your submission by locking their submission and see the code to previous problems.
Oh yes that can happen. Never thought of it though thanks for pointing it out.
I used unordered maps in my solution as well :/ (358577411: TLE), why exactly is it an issue to be using this?
Changing it to map worked (358864139: AC). Ahhh! My ranking increased by 1000 just because of this :(
The worst case time complexity of unordered_map is O(N) due to hash collisions, though the average tc is O(1). so, it fails on many cases when it reaches its worst case complexity.
thanks to the authors and organizers for putting this round together! a really apreciable work tbh
true that
i'm happy that you enjoyed it!
its so peak
too late for a tester comment, you can no longer farm contribution :(
Codeforces Round 1072 (Div. 3) < this Div 4
difficulty wise NO , but the problems were quite creative relative to previous rounds , nik_exists ORZ
I meant getting full AC on div 4 was harder than doing that in Div 3
I was doing 900 rated and now i am also doing 1000 and 1100 with it like i am unable to think of approach but trying to think of it , can anyone who is good in cp can tell me am i doing right or not?? and please suggest something for future.
this is normal. moving to 1000–1100 takes time, nothing wrong with it.
http://codeforces.me/group
Hi MikeMirzayanov and Codeforces team,
I received a plagiarism notification for my submission 358567938 for problem 2185F.
I am writing to clarify that I wrote this solution locally using VS Code and did not share it with anyone or paste it on any public online compiler (Ideone/Pastebin).
Please consider the submission timestamps as evidence: * My submission: 358567938 * The coinciding submissions are 358612438 and 358616896.
My submission was approximately 44,000 IDs earlier than the others. It is impossible that I copied them, and since I used a secure local environment, I did not leak the code. The similarity is likely due to the highly standard nature of the solution for this specific problem type (Segment Tree Tournament).
I request you to review this case as a False Positive caused by convergent code logic rather than a rules violation.
Thank you.
Hi MikeMirzayanov and Codeforces team,
I am writing to appeal the plagiarism flag for my solution 358567938 for problem 2185F.
I respectfully request a review of this case based on the submission timestamps, which prove I could not have copied the other flagged users.
Evidence: 1. My Submission: 358567938 2. Flagged Match 1: anuradha.codeforces — 358612438 3. Flagged Match 2: SYNCHRONOX — 358616896
My submission was made approximately 44,000 IDs (significant time duration) earlier than the coinciding solutions.
Since I submitted first by such a large margin, it is impossible that I copied these users. I wrote this solution locally in VS Code and did not use any public IDEs (Ideone/Pastebin) or share my code.
The similarity is likely due to the highly standard nature of the Segment Tree Tournament algorithm required for this problem, or I am the victim of a leak I am currently investigating. Given that I am the original author by a significant time margin, I ask that this penalty be reconsidered.
Thank you.
I am writing to clarify the similarity warning for contest 2185, problem E (https://codeforces.me/contest/2185/submission/358601711). I solved the problem on my own during the contest. My solution was to sort the dangerous points, compute for each robot the distance to the closest point of danger using binary search, bucket the robots by distance, and then process the movement string greedily by maintaining the new left/right extremes and removing a robot only when a new extreme is reached. This is the obvious greedy solution to this problem, and it results in similar solutions being written by different participants. I did not copy code from any participant or anywhere else. Happy to clarify further if needed.
To provide further background, my submission was earlier in the contest, while the similar solution was submitted much later. I did not copy code from any contestant or elsewhere.
I also wrote and tested my solution locally using the C++ compiler in VS Code, not on any shared or public online IDE. I did not copy code from any participant or external source.
Hello,
I would like to clarify regarding submission 358606906 for problem 2185E. My solution was implemented independently, based on a commonly known approach that was publicly available before the contest.
If required, I can provide references to the source or explain my solution logic in detail. I had no intention of violating Codeforces rules. Also you can check the timestamps and my attempts to solve the problem. I have been constantly working on the problem and at the end made it. Please check this things.
Thank you for your time.
My submission has been skipped. It was because I had submitted the same solution from this account "vedjaw" and my other account "xyz123456789". Pls look into this and revert the stats. The same is the issue for all of the other problems.
This is explicitly forbidden by the rules that you agreed to when signing up
I had been wrongly accused of cheating of solution of2185E in 358618831 as I first of all gave the contest unrated secondly the question I have been flagged has only similar variable names because of the question being previously asked in a particular round and while compiling I copy pasted most part of code
Secondly my code has used map and vector which are not used in the other solution which i being flaggged so I request that the solution to not be skipped and not to flag me for this particular time.pls check the flagged solution
do you always use gdcode as a variable name? (am just curious)
I remember the code i copied this was from a question where the string was asked to be good or not thats why
I would like to clarify that my solution for this round was written fully independently.
I submitted my code (submission 358590936 for problem 2185E) earlier than the mentioned similar submissions (358598078), and I had no access to or knowledge of them.
I did not share my code with anyone and did not use any public online IDE/paste services during the contest.
Regarding similarity: the solution follows a common approach derived from constraints (record first occurrence time of each prefix displacement from the movement string, then for each position use lower_bound on sorted b to determine the earliest time it becomes invalid).
Therefore, any similarity is likely due to the common solution structure for this problem.
I am happy to provide further explanation or details if needed. Thank you for your consideration.
.
Hello
What are you going to say about this 360556864 Bro you are clearly cheating and then commenting(even comment is written by GPT) that you haven't cheated?
I don't said this 360556864 and the comment is written by me
You shouldn't be so confident on a WA-on-test-1 code...
VSS402002_Muhammad_Adil bro I am saying that you are cheating and if you say that you haven't, then you can see your WA1 it's clear GPT btw you also forget to remove "" while copying ur comment :)
ASSLAM o ALAIKOM
https://codeforces.me/contest/2185/submission/358521009
Let's be real, aren't you the greatest sleep deprived coder in existence? You are a great pursuer of techniques, right?
Stop lying...
Faraz are vss part I am a vss part are you know sir sajad or sir sajid
hello
Hello Codeforces Team,
I am writing to sincerely apologize for my actions during the last round. I must admit that both accounts (BEKSULTANOV and Azama1-B-Nurmakov-28) belong to me.
I made a very stupid and immature mistake by participating with two accounts simultaneously. I manually modified the code for the first five problems to avoid detection, but on the sixth problem, I accidentally submitted the identical code. I now realize that this was a serious violation of Codeforces rules regarding multiple accounts and fair play.
I did not use anyone else's code; all solutions were written by me personally. However, I understand that my behavior is unacceptable. I am deeply sorry and I have learned my lesson.
I am ready to accept the disqualification for this round on both accounts. I kindly ask you not to ban my main account BEKSULTANOV permanently. I promise to stop using the second account and never break the rules again. I value the Codeforces community and want to continue competing fairly.
I don't believe you get banned for a first offense.
.
I'm referring to BEKSULTANOV, but considering you're cheating in other rounds, if you continue, you'll probably be banned :)
Regarding the similarity warning for Problem 2185E – The Robotic Rush : I would like to clarify that I did not copy or share my solution. I wrote the code entirely on my own using VS Code locally. Given the nature of the problem, I believe the similarity is purely coincidental and likely stems from the standard logic required to solve it and similar variable names. I fully respect the contest rules and integrity. Please Judge my solution (358618545) fairly.