Hello, Codeforces!
I am very excited to invite you to my first-ever contest, Codeforces Round 1034 (Div. 3), which will start on Jul/01/2025 17:35 (Moscow time)! In this contest, you will be given 2 hours and 15 minutes to solve 7 problems.
The round will be hosted by the rules of educational rounds (extended ICPC). Thus, all solutions will be judged on preliminary tests during the round, and after the round, there will be a 12-hour phase of open hacks. After the open hack phase, all accepted solutions will be rejudged on successful hacks. Also, note that there is no score distribution — rank will be determined by number of problems solved, followed by penalty; wrong submissions will incur the usual penalty of 10 minutes, following the rules of educational rounds.
As a reminder, only trusted participants of the third division will be included in the official standings table. This is a compulsory measure for combating unsporting behavior. To qualify as a trusted participant of the third division, you must:
- take part in (and solve at least one problem in) at least five rated rounds
- and not have had a rating of 1900 or higher at any moment in time.
Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you (unless you register unrated).
Also, note the rule restricting the use of AI. If you are caught breaking this rule, you will be met with unfathomable punishments, so for your own well-being, I highly recommend adhering to the rules.
I would like to thank the following people for helping make this round possible!
- cry for being a very orz coordinator, and Vladosiya for translating the statements into Russian;
- Lilypad for being my sounding board for problem ideas;
- Dominater069, __baozii__, AksLolCoding, Proof_by_QED, Edeeva, -firefly-, efishel, Friedrich, Vladosiya, Hori, macaquedev, DivinePunishment, SpyrosAliv, beaten_by_ai, Filikec, Non-origination, kevlu8, yse, and AG-88301 for testing;
- Intellegent and chromate00 for pretending to test;
- MikeMirzayanov for the incredible Codeforces and Polygon platforms;
- and most importantly of all, You for participating!
Good luck, and have fun!
Update: Editorial









As a tester, I enjoyed the problems and encourage you to participate.
Hope to reach green again in this round and
Not to see Pupils and newbies in top 10
currently one of them is in top 14 :)
2 pupils and 1 newbie are in top 10 rn
As a participant, I too enjoyed the problems
yea contest was best others are very hard this one was best
Hope I can reach specialist again (bad perf too many times already — nooo)
As a tester, I recommend everyone to watch Toaru Kagaku no Railgun.
How it can helps us?
It's soooooo good! I recommend it too. Gives +500 elo boost ;)
I didn't understand it
But I don't play chess!
Already watched !
I've heard of it but never got to it cause of Magical Index :/
As a tester, I like being at the front of the list of orange testers.
As a tester, I'm going to send every single GPT cheater into cry's basement and lock them up so they never see the light of day ever again.
As a nontester, I concur with this
As a tester, you do not want to know the unfathomable punishment that is cry's basement
i can confirm that cry's basemet is so scary that you'll pass out because of it
hasn't the basement over-flooded already?
Hope no one will try to go to cry's basement!!
You better to do nice problems, cause I wanna get my super serious specialist. I think you wouldnt like to visit cry`s basement the rest of your life... in gta 5...
"As a beginner, I will try to solve at least two problems,Insha'Allah.
As a real not-pretend tester, do the contest.
no div3 tester for a div3 :(
a normal div 3 round usually contains question(s) that even I can't solve.
thats true
mb!
I understand that the upper bound of difficulty is often beyond what a div3 person can solve, but even still I think having div3 testers would still be very useful to get a wide range of perspectives
As a so called pretend tester, I’ll have you know I solved a non-zero number of problems whilst testing the contest.
Negative be like
You solved it in the last minute...
Thanks for spoiling contest difficulty, now I know at least one of the problems is solvable :(
As a chkek person, I hope I don't face technical issues 5 minutes before the round and have to skip.
chkek
chkek
Hello alnq
chkek
i find ur dp distracting
Hope that I dont choke like last time, last round i choked so hard rollback saved me from turning green
I'm going to participate in tomorrow's Codeforces Div. 3 contest after a long time, looking forward to it!
Count me!
Hopefully, the rating changes will be applied before 2030.
as an unofficial and un-trusted participant, i convinced my friend to do this contest
Hoping for a nice contest
I’m waiting for an amazing contest.
Hopefully, I will become Specialist for the first time after this round!
hope the problemset is awesome and enjoyable !:)
As an unrated participant, I urge all unrated participants to not attempt contests from ALT accounts. (Do not snatch from the poor, karma hits)
Wish me luck pls for reaching to Green line!
Will the theme of the contest be Toaru Kagaku no Railgun?
no, there's no theme for this contest unfortunately
maybe i'll write another contest when season 4 comes out though... we'll see :)
No need for 12 hour hacking period 1-2 is enough. Otherwise we have to wait 4-5 days for results.
I don't like so much time of hacking either
get addicted to hacking u will think 12hr is also less
This will be my first contest on a time basis. I have partipated in Hackerrank euler+ and loved that. But now there is pressure! I have tremendous respect for everyone who participates in these contests and hope to participate in many more.
Please try to speed up the result-publishing process. In these type of extended-ICPC rounds, we have to wait an unnecessary 12 hours for hacking phase. Then a 3-4 hour gap for absolutely no reason. And then, the system testing takes like eternity. After going through all this, we have to wait another prolonged period of time to get the ratings. These experiences had been quite unpleasant over these couple of months.
I hope to reach specialist after this round and all participants get positive delta.
long time no contest, hoping for positive delta.
Why no DIV 4 is coming, Hoping for a DIV 4 before GTA 6.....
I might finally reach green this time, I am going on a good pace :)
good luck bro
Hope this time the rating will be updated before releasing of GTA 6
Thank you for the contest
I hope I'm improving through practice.
Best luck to all participants :3
Where is that meme (Expert be like : I'm out of competition) ???????????
oh God my hope is to be end that we can`t get div.4 before GTA VI
I hope too !!
First time i can say, I'M OUT OF COMPETITION!
I hope to try the same feeling after the round.
i hope you do!
Hope to AK the round!
Couldn't make it :(
problem G was too difficult for me
Fun (and knowledge) is main
hoping i don't bottle this time (pls i wanna reach green)
Make sure that you are around 6000 on the standings...
Hoping to make a delta of +100 jump tonight..!
tired of solving 4 questions and falling down to newbie. Hope to solve 5 questions
I think, the 5th one needs a little algorithmic touch...
How to join unrated?
gg, getting negative delta ig
Me To, :(.
Too tight TL on G imo
sum of $$$m$$$ is not limited
Oh you are right.. my bad
What's the main idea of problem G?
Pen,Paperforces
It was a great contest. Except for problem A, I found the other problems clear and approachable. Managed to solve upto D and gave F a try. I do regret registering as unrated.
why my D wrong https://mirror.codeforces.com/contest/2123/submission/326971064..?
I am unable to view your submission right now. It was mostly checking the number of 1s in the string and the value of K. if K is greater than n/2 for even or n/2+1 for odd or number of 1s Alice will win. Otherwise Bob.
https://mirror.codeforces.com/contest/2123/submission/326971064 now check
can someone explain D ?
If initially the amount of 1 is no greater than k or the length n is less than 2*k,then Alice win.
c1 = number of 1 in s
if c1 <= k => Alice win
if n < 2 * k => Alice win
otherwise Bob win
Could you please explain the reasoning behind this approach? How did you come up with these conditions to solve the problem, and why can we be confident that they always lead to the correct result?
If initially the amount of 1 is no greater than k,Alice can win in the first round.If the length n is less than 2*k,every time Bob operates,it must change some certain positions (like k) into 1,then if Alice doesn't change these positions into 0,the amount of 1 will eventually lessen to k.
Loved solving E
Thank you authors
Is it just me or is problem D is actually significantly easier than problem C? I tried problem C for like 1.5 hours but didnt get the solution, meanwhile D was quick to solve
i solved c pretty quickly and was unable to figure out D rather
I stucked at B that's bad . Can any one explain it for me please
if k == 1 then element should be maximum element else k > 1 then we can always pair maximum element and jth element and removing others with the help of these 2 elements till we have elements > k
Look player j can always come in top 2. Its possible, when the player with highest score defeat everyone else, except the player j. (i.e. the case when we have match of every player except j with highet rated player).
Now, we need to check whether jth player can be in top 1 or not. If he has the highest score, he can, otherwise no.
consider the max element int the array. It can defeat all other elements. So now if max element= aj then he can defeat everyone and answer is yes else if there are n-k elements present in the array other then max element and aj then we can send them first and in this case as well answer is YES.
So two conditions: max_element==aj OR n-2>=n-k
Hope it was clear!
can anyone explain problem D — I tried and tested it on my Python IDLE too but somehow it was showing wrong answer on test 2 my submission
If the number of 1s is equal or smalle than k, obviously Alice will win. Keep writing down the test cases on paper until u realize that Alice can't win when 2 * k <= n.
How could you "realize" that so fast? please teach me
I just do
Thanks bro!
Nice contest! Best description and questions comparing with the few past contests! Problems are clear and fresh to look at. I solved 5 problems and a bit regret to register unrated. (Although I'll still lose rating if it's rated lol)
Got stuck in problem B for five tries until I found that I input k and j in the wrong order OMFGGGG!!!! (At 2 hours :)) Never done such stupid thing before!!
Anyways, good contest and looking forward for the editorial!
UPD: Super quick editorial out yay :)
i have started learning programming 1 month ago, joined codeforces two weeks ago, problem count 5 in first contest(obv this one) i only able to solve problem number B. Am i left behind....how to recover it...seniors do u have any suggestion?
guessforces
Stuck at problem D QAO It took me 100 minutes
I'm the same way, and I can't solve it.
The editorial got uploaded pretty fast!.. Crazyy and thanks!
guessforces !!!
orz, thanks for the super fast tutorial.
Easiest Div 3 ever, managed to solve 5 problems without a lot of fuss, shocked to see like 5000 submissions on E problem, anyways thanks @reirugan for setting up such a nice contest, A,B,C,D felt like they were in decreasing order of difficulties.
do you have any proof why your D works and how did u do it?
For me, it was clear that the smaller the string, the more Bob was in favor, and the larger the string, the more Alice was in favor. I found the relationship experimentally using sample test cases and I also found the special case, but I didn't have proof why it had to be greater than twice as large as K.
was this div 3 contest one of the easy ones ? or just i am getting better ?
was solving prev div3 questions , and for me C questions were a bit tricky to implement , alsways ended missing a key point in the solution. Yeah could do 80% of C . But in this contest i solved upto D , and could even figure out F , just couldnt code in time.
I guess the contest was easy one.
same. This contest is by far the easiest div 3 I've ever done
Somebody injected a TLE when the number of bits sets in $$$n$$$ in problem F is $$$11$$$. The code got copied all over the place.
I had the solution for problem D, but messed up the for-loop range when counting 1s and ended up stuck on it for an hour — such a shame
D number problem could have been better.
yeah agree , even c too , as a newbie solving D means wasnt that good ..
can anyone give idea about D my approach is like to search the 1 who is part of all substring which is equal to cntk and total count of 1s is cnt cnt-cntk>k then bob win else alice what is wrong with this approach
bro its simple , cnt(1)<=k alice wins, if k<=n/2 --> bob wins else --> alice wins
dont know how to give u the idea , but i just built it upon intuition and observation
u can try out examples and verify
please can I get rating I had a internet issue I was waiting from a week for this I practice alot but when my internet fixed it was too late only 1 min was remaining I have done 4 problems A,B,C,D after contest please give me the rating if u can give please or please give me extra time please I just wanna complete 1400 rating by my self and this was a chance for me I'll check my internet next time reirugan
thanks
-- VSS102484_farazUsman
Guessforce
From the submissions, it seems like we going to see lot of plags
This was one of the best div 3. Specially problem E & D are too good :)
Ya, problem E is good
E was a good problem. F was good too. Overall a balanced and good problemset!
Screencast with commentary
Hi, I participated as a rated parcitipant. When will I get the new rating? Thanks
Problem E is interesting.
Problem G: I notice that there are at most 200 different factor for m <= 5e5. So for every factor I build a segmentTree.But I got Memory limit exceeded on test 13...
You have three vectors with 4n size, so that's $$$12n$$$. You are storing $$$200 * 12 * 100000 = 2.4*10^8$$$ integers. Should be too much.
Yes you are right.o( ̄▽ ̄)d
Esbar mehnga wala ganja phook ke aya he
Yay 4 problems solved :D
This contest was hard ngl
I wasn’t planning to participate, but at the last moment I thought, let’s give it! And wow it turned out to be my lucky contest!!! Ended up getting an official rank of 92 that was totally unexpected! I wasn't ready for that mannn!
I’m going to be an Expert now lol! well I might fall back to Specialist after the next contest but still I will have an Expert max rating now yeeahhh.
This honestly gave me Luffy Gear 5 level goosebumps
why its not showing my rating it was my first contest
amm rating hasnt been updated yet it will get updated soon enough dont worry
Thank you for such a mind blowing contest!! I Litrally have no words rn….
Your progress speed is really impressive! Could you share what you do to improve from a pupil to an expert (or even a higher level) in just half a year?
So this is the first time I am speaking about my progress. So I put some time into thinking what to write.
Firstly, I am an engineering student who cleared the JEE Advanced exam to get into IIT Varanasi, so I got my maths foundation from studying for the exam.
About before, I was a rage coder I guess, I used to force myself to find a solution to the problem I was looking at, instead of going with the slow of the problem and attempting those which I could solve, I used to try to solve the one in front of me.. I think that really held me off.
So I decided to up skill myself reading some books, the one which I found really interesting was a competative programming book — Competative Programming 3 by Steven and Felix Hamlin. It really helped me put my idea into words and writing, which helped me build upon the part of the solution I already had done,.. So this step by step process is actully what helped me I guess. Also Shayan's YouTube channel proved really helpful for me. Also this round was so mathematical and my simple yet good background in algebra and number theory proved useful here.
Throught the whole contest I was just focused on solving the questions I believed I could solve, tho I did solve everything at the end, but I never expected it from me.
Also, to add I believe this was a really "right time, right place" thing happening with me, some might call it a fluke... but then I remember what Kevin Malone from "The Office" would say to this:
"Look I know it's easy to say tonight was just a fluke, and maybe it was, but here's a piece of trivia — a fluke is one of the most common fish in the sea. So if you go fishing for a fluke, chances are you just might catch one."
I really like Problem E, even though I didn't manage to solve it during the contest.
loved the questions, solved 4 in first 30 mins, 5ht took time due to silly but and got logic for 6th but couldn't complete it
I solved two problem,and this is my 2nd contest,why there is no change in my rating??That's discourage me
Cause you registered as an unrated participant lol.
What is it means??
how can i registered as a rated participant in the upcoming contests??
OKAy now i understand your comment...
very good round
Hello, I received a message saying that my solution (326916394) for problem 2123E significantly coincides with other participants' submissions.
I would like to clarify that I wrote my solution entirely by myself and did not copy from anyone or share my code intentionally. However, I used online-python.com to write and test my code during the contest, and I was not aware that sessions on this site are public by default. It’s possible that someone else accessed my code and submitted it without my knowledge.
I sincerely apologize for this mistake and assure you it will not happen again. I will avoid using any online IDEs in the future unless I can guarantee they are private. Please let me know if there is anything else I can do to clarify this situation.
Hello, I received another message saying that my solution (326909726) for problem 2123D significantly coincides with other participants' submissions.
As I mentioned earlier, I wrote my solution entirely by myself and did not copy or share it intentionally. However, I used online-python.com to write and test my code during the contest, and I was not aware that sessions on this site are public by default. It’s possible that someone accessed my code and submitted it without my knowledge.
I sincerely apologize for this mistake and assure you that it will not happen again. I will avoid using any online IDEs in the future unless I can guarantee they are private. Please let me know if there is anything I can do to clarify this situation.
I want to bring to your notice about Flase Plagiarism on my solution /326927720 of the recent Div.3 . My solution is same as the alternate soltuion provided in the editorial. The similarity might have arrived due to use of Co-Pilot auto suggestion feature which i forgot to turn off in hurry.
According to the rules of the platform ,use of auto completion tools is allowed and here it was just generating some for loops and declarations .
I would request you to kindly look into this matter. I have solved more than 150 problems in the past month to improve my preformance and got this as a result , just because I used copilot auto suggestion in the contest which is legal according to the fair participation rules.
I received a plagiarism warning due to similarity with another user's submission. I want to clarify that I wrote the code myself during the contest. However, I used an online https://ideone.com/ with public visibility which may have unintentionally exposed my code.
I had no intention to share my code, but someone might have accessed and copied it while it was publicly viewable. I accept that this was careless and I will strictly avoid IDE in he future.
I sincerely request that you consider this in your review. I take full responsibility for the mistake and will ensure it doesn’t happen again.
Dear Codeforces Team,
I have received a notification that my submission [326961702] for problem 2123E significantly coincides with those of other users. I would like to clarify that any similarity is purely coincidental.
I wrote my solution independently during the contest and did not collaborate or share code with anyone. However, I did use the CodeChef online IDE during the contest to test my solution. I was unaware that code submitted there might be publicly visible. If this caused unintended exposure of my solution, I sincerely apologize — it was not deliberate.
I take contest rules seriously and have always aimed to compete fairly. I request you to kindly review my case, as I had no intention of violating any rules.
Thank you for your time and understanding.
Hello Codeforces team, I received a plagiarism warning for problems 2123D and 2123E. I want to respectfully clarify that I wrote my code independently using VS Code, which is integrated with GitHub Copilot. As Copilot provides AI-powered suggestions based on standard coding patterns and common algorithmic structures, it's possible that my code may coincidentally resemble that of other users who used similar logic or tools. I have never shared my code with anyone, nor have I used any public platforms like Ideone. I strictly follow fair contest practices. I hope you will kindly review my case. I truly respect the Codeforces platform and would never engage in dishonest activity. Thank you for your time and understanding. I have even solved nearly 250 questions in past 1.5 months which clearly depicts that I am working rigorously Hard to gain rating
Dear Codeforces Team,
I have received a notification that my solution (ID: 326931703) for problem 2123E significantly matches several other submissions.
I would like to sincerely clarify that I did not share my code with anyone, nor did I use any public IDE like ideone.com — in fact, I was unaware of ideone and similar platforms before receiving this message.
I wrote my code independently and submitted it during the contest in good faith. I have always respected the rules and spirit of fair competition on Codeforces, and I am surprised to see such a large number of similar submissions.
If there was any unintentional coincidence or leak beyond my knowledge, I truly regret it. I kindly request you to re-evaluate my case. I am fully committed to maintaining integrity and ensuring such issues never arise in the future.
Thank you for your time and understanding.
Sincerely, Kuldeep Das Username: kuldas1531
Hello Codeforces team,
I received a message about my solution to problem 2123E coinciding with other submissions. I want to clarify that I wrote the code myself and did not intend to share it with anyone.
However, I now realize that I used an online compiler during the contest, and I was not aware that it might have made my code publicly accessible. I sincerely apologize for this — it was purely unintentional, and I had no idea that it could lead to such an issue.
I take full responsibility and assure you that I’ll avoid using any public IDEs in the future. This was my first mistake, and I hope you’ll consider it as such.
Thank you for maintaining the integrity of the platform.
Hi, my handle is ris_007. I registered and submitted during Codeforces Round 1034 (Div. 3), but I was marked as "unrated registration" even though I participated live. Could you please check if this is an error?
Thanks.
Dear Codeforces team,
I have received a message regarding solution 326964215 for problem 2123D coinciding with other users' submissions. I would like to clarify that I did not intentionally share my code with anyone, nor did I copy from any participant. It is possible that someone might have accessed my code if I used a public IDE or an exposed repository by mistake, but I had no intention to leak or break the rules.
I fully respect the Codeforces rules and will make sure to use private and secure environments in the future to avoid any unintentional sharing. Please let me know if you need any more details from my side.
Thank you for your understanding.
Appeal regarding plagiarism notice for submissions 326844493 and 326852638 I received a plagiarism warning for problems 2123B and 2123C. I want to clarify that I wrote both of these codes entirely on my own and completed them well before 8:30 PM. I later noticed that another user submitted very similar code after 10 PM. I did not collaborate or share my code with anyone during the contest, and I suspect it may have been copied from a source where my code was unintentionally visible (perhaps a public IDE). Submission links: https://mirror.codeforces.com/contest/2123/submission/326844493 https://mirror.codeforces.com/contest/2123/submission/326852638 I request the moderators to kindly review the submission timestamps and context. I will be more careful in the future to avoid any unintentional exposure of my solutions. Thank you for understanding.
Hello Codeforces team,
I recently received a notification regarding code similarity in my submission for problem 2123E (submission ID: 326967131), and I would like to clarify my side sincerely and respectfully.
During the contest, I was using an AI code completion tool (similar to GitHub Copilot or other IDE-based assistive features) to help with syntax and general code writing. At no point did I input the problem statement or request a full solution from any AI system.
I now understand from your AI policy (revision 2024-09-14) that:
"AI-based code completion systems may be used, but only for syntax and minor coding suggestions. Using them to generate the core logic or algorithms... is not permitted."
While my use was limited to accepting suggested variable names, boilerplate structure, and loop constructs, it’s possible that the suggestion aligned too closely with others who used similar tools — resulting in coincidental similarities. I did not collaborate with anyone, nor did I share my code.
I truly respect the spirit of fair competition and now realize that even passive acceptance of AI-generated suggestions could resemble rule violations unintentionally. I will completely avoid using such tools during contests going forward to prevent any further issues or misunderstandings.
I humbly request you to reconsider the penalty or review the context of my submission with this clarification in mind. Please let me know if I can provide any more information.
I cannot see other people's code in the open hack stage of div3, and it shows N/A. How can I solve this problem? Is it a blind hack? In addition, I successfully became a green name after two div2 games, but now I still cannot see other people's solutions. How can I solve this problem? Or what specific requirements must be met to be allowed to see the code?
D was tricky!!
good contest