Hello, Codeforces!
We are excited to invite you to DeepInfra Round 1 (Codeforces Round 1126, Div. 1 + Div. 2), which will take place on Oct/10/2026 18:05 (Moscow time)! Note the unusual start time of the round.
You will have 3 hours to solve 8 problems, one of which is divided into subtasks.
The problems were prepared by employed and reviewed carefully by nifeshe. We have put a lot of care into creating and testing this problemset, and we hope you will enjoy solving the problems as much as we enjoyed preparing them!
A huge thank you to everyone who helped bring this round to life:
- nifeshe for coordinating the round and being funny, cool, and smart!
- Dominater069 for the early review of the problems.
- EvenImage, AksLolCoding, ApraCadabra, Euclid73, linearspace, Mohammad_Hacker, naneosmic, nik_exists, omsincoconut, Pie_TealCompressorDragon, Rising-coder, Rvess, Sana, zyadhany, _______________________, FetFot, A_G, flammifer, and catgirl for testing the round and helping us improve the problemset.
- nifeshe for translating the statements into Russian.
- MikeMirzayanov and KAN for the Codeforces and Polygon platforms.
Honorable Mentions
A special thanks to our most disciplined testers, who joined the testing phase and successfully resisted the temptation to open a single problem:
cadmiumky, Um_nik, _istil, Intellegent, cgmoreda, sammyuri, Error_Yuan, cry, SpyrosAliv, and Arpa.
Thank you for your statistical contribution to the testing group's headcount.
Score distribution
| A | B | C | D | E | F | G | H1 | H2 |
|---|---|---|---|---|---|---|---|---|
| $$$500$$$ | $$$1000$$$ | $$$1250$$$ | $$$1750$$$ | $$$2250$$$ | $$$2500$$$ | $$$3500$$$ | $$$3000$$$ | $$$2000$$$ |
And now, a few words from today's sponsor!

Hello Codeforces!
We’re excited to welcome you to DeepInfra Round 1
At DeepInfra, we build high-performance AI infrastructure that makes running the world’s best AI models fast, reliable, and accessible. We work across the entire inference stack—from GPUs to APIs—solving challenging engineering problems with a strong focus on performance and efficiency.
Our team has deep roots in Codeforces and competitive programming. One of us even competed in Codeforces Beta Round 50, so we’ve been around since the early days!
We prepared great prizes for the winners:
- Top 3: 1000 USDT + merch
- 4-6: 250 USDT + merch
- 7-10: 150 USDT + merch
- Random 10 from the top 100 (rank 11-100): merch
We’re growing! If you enjoy problem solving and want to work on challenging systems at the intersection of AI and infrastructure, we’d love to hear from you.
To apply for Software Engineering interns and full-time positions, fill in the application form and we will be in touch.
Good luck to everyone competing — have fun, and we’ll see you on the leaderboard!
— The DeepInfra Team
PS We reserve the right to apply strict compliance checks when finalizing the results in order to prevent unfair participation and rule violations.
Please note that prize delivery to certain countries, states, provinces, or territories may be subject to applicable sanctions, trade restrictions, or other legal requirements. We will make every reasonable effort to deliver prizes to all eligible winners, subject to any restrictions that may apply.
See you on the leaderboard. Good luck, have fun, and may your submissions turn green!
UPD
Congratulations to the winners.
- QwertyPi
- LMydd0225
- Kevin114514
- squareOf105
- Radewoosh
- 353cerega
- radoslav11
- idontwannadothisanymore
- potato167
- jiangly
First solves: (subject to change)
A. by skinnyasiandude
B by turmax
C. by Kevin114514
D. by Prashant_ksy
E. by ksun48
F. by ItzsleepyXD
G. by PelicanPilot
H1. by Kevin114514
H2. by squareOf105








Finally another Div.1+2 after 3 months....
Then pupils, newbies and unrateds will go and destroy the standings with their gods. :)
Hope to become Specialist again!
Hope to get everything back I lost in past few contests...
I hope to become an expert
Finally a Jordanian round by the goat himself
as a tester
How many underscores are in your name?
23! (yes factorial)
orz _______________________
Sorry guys it took me few revision to ping him/her instead of somebody else
hmmm your revision 4 is particularly interesting but Id like to say it would have taken me way more than 5 revisions to get it right.
Actually when I tag that guy, he/she changed the handle into something else so that's why it's about_30_ninjas instead of a bunch of ____
I wonder how they changed his name in october is it possible?
Try pinging ______________ and I think you would understand
oh wait I understand now sorry lol anyway about_30_ninjas
Hopefully I can reach specialist this contest
Just one word, it is called “bestcpintheworld”
As a tester, can I participate then?
nifeshe
Yes
As a tester, I am un employed
I though that your work is gaining contribution.
sadly, #2 in cf contribution doesn't really count for anything but bragging rights
thx for honorable mention means a lot
As a tester, problems are hot, but author is even hotter
:skull:
unfortunately i cant say the same thing back as you are a minor
Finally, my testing skills have been acknowledged
My first Div.1+2 after reaching 2100 let's GOOOOOOOOOOOOOOOOO
Yeah, I am definitely getting cooked.
as a tester, i wish i could get an honorable mention too.
Usually I do badly in long rounds hope I can redeem myself
As a tester who could not resist the temptation to open the problems, I hope you all enjoy them as much as I did.
I am afraid of giving those contest when there is prize in it, because there is more cheating in those contest.
Sorry I am new, is this going to be rated?
Hi, sponsored rounds are open and rated for everyone! Hope you enjoy the contest
As a tester, employed is the GOAT
By looking at the score of the problems, HOLLLYYYY, WE ARE COOKED
H2 has less score than H1? how does that work?:-)
H2 is a subtask of H1, usually with higher constraints, so the total score if you solved H2 which would also solve H1 since it's just optimized for higher constraints would be 5000 score — time it took to solve (i dont know why it put an emdash, i put -)
thanks!
As a participant I encourage the arab writers problems ,testers, judges for hard perseverance , I want to say good luck for participants and I hope for us lucky contest
As Misaka16172, hope I become CM
Good luck to everyone participating in this contest! I wish you all the best and a fair contest.
Why is the score for H2 lower than H1?
it is like H2 = H1 + H2 .. coz you also make effort to solve H1 first.
Hope to become Specialist again!
As a "مقصّر" tester, I'm glad I didn't make it to the honorable mentions.
contest after a long bit ;pls no back to noobie
as an un employed person hopefully I'll be employed after this round
no way dominater reviewed this round lol
Hope I can become a newbie
by submitting to any problem as unrated means you will get at least newbie after the contest is over
After months of total zero practice im so happy that i solved the first two problems only. Even that im in beauty university still can knockout some people.
I don't deserve this h2 lol
Problem $$$D$$$ is so easy to think of the solution but real hard to implement it cleanly. Otherwise a relatively easy problem.
$$$C$$$ on the other hand gave me nightmares.
I agree entirely
Agreed completely about D. The way that I did it is somewhat decent compared to my first alternative I thought of: turn it into a range [L, R) and split it into +[0, R) and -[0, L) then do sweep line adding lines up because the function is piecewise linear. Still not good.
For C though: find the biggest power of 2 you can use. You can use all bits until that bit freely. Just do that and repeat each prefix xor one extra time by adding 0 inbetween. So a convenient construction is just having prefix xor 0 0 1 1 2 2 3 3 ... power-1 power-1 (power-1)^power then repeat the same part from before to pass through numbers that have the highest bit on.
Problem F is excellent, I like it!
Idk why I participate in these combined div 1 + div 2 rounds for 3 hrs. I will never be good enough to perform well in these. Only outcome is -70 delta everytime fml
Enjoyed the problems alot, very good contest
C is gangster!!!
Solution sketches for A-D (I didn't get cooked):
A. If $$$a+1 \lt b$$$ print $$$-1$$$ otherwise print $$$a$$$ if $$$a$$$ and $$$b$$$ have the same parity otherwise $$$a+1$$$
B. Consider the frequency array $$$c$$$ of $$$a$$$, if there is a prefix of length $$$x$$$ in $$$c$$$ where the first $$$x-1$$$ elements of it are greater than or equal to $$$2k$$$ and the last is equal to $$$2k-1$$$ print YES otherwise print NO
C. Let $$$x = \operatorname{msb}(n)$$$, $$$k = 2^{x+1}-1$$$, then print $$$\lfloor 2^{\operatorname{lsb}(i)-1} \rfloor$$$ for $$$1 \leq i \leq k$$$
D. The slope of $$$f(x)$$$ changes at the key points $$$l-m+1$$$, $$$r-m+2$$$, $$$l+1$$$, and $$$r+2$$$ for each interval, so put all these points in a map and do some math to check if $$$k$$$ is between pairs of points
Enjoyed the contest
wtf is msb
It stands for maximum set bit
And LSB is least set bit
*most
Significant**
Bit***
For C, I came up with x=msb(n) and maximum possible xor to be 2^(x+1)-1 but however could not come up with the construction 2^msb(i) for 1≤i≤k.
I figured it out by looking at the prefix XOR, the prefix XOR of this construction will have every possible number appear only twice
I managed to solve 3 problems, yay!
congrats on pupil XD
who say Ahh ?
Did H remind someone else of a certain problem in Looking for a Challenge? Now I regret not trying to understand its solution a bit more.
Also how to reconstruct the answer from the binary search in E?
You binary search on number of [x] -> 2 * [(x + 1) / 2] operations, if you do these operations x number of times, then total number of operations is n + 2x
Also order of moves dosen't matter so we can assume that all halving moves are done first
After that we are left with n + x constraints for resulting array a1, a2, ... a{n + x}
ai <= k + x + (i — 1)
We can use binary search as if constraints are satisfied for some moves for x, then for x + 1 we can simply halve a{n + x} to make it satisfy constraints for x + 1 also
For checking for some x, you can greedily pop out maximum element from array and check if that highest element has a suitable index, if there is, then we got it placed(place it at highest such possible index) else split the highest number as else it cannot be put anywhere
I think binary search with greedy scanning is a good idea
When will ratings change ?
(Participating after 2 years)
Typically, from 2 hours to 2 weeks
While in early times I use to struggle with bits generally it appears in question B then I gave time read it patterns and I am able to answer it now it mostly appears at c and I cannot solve that after contest when I try toh find answers it always associate a new property of xor .,.....how to overcome it .......i already done 2-3 yt playlist and knows the basic
new color :yay:
Thank you for the contest!
I like how natural the problems are.
best cheater in codeforces get 3000+ rating idontwannadothisanymore cong. bro!
employed thank you for contest!
My Codeforces account chaitanya9999 has been disabled. I believe this may have happened due to a false positive or a misunderstanding, so I am respectfully writing to appeal the decision.
I want to state clearly that I did not cheat. I have never copied someone else’s code, shared my solutions during a contest, used another person’s account, or used any unauthorized help like AI. All submissions from my account were written by me.(only the template i use for some functions from past was written before as i use it in each submission and also i wont use it for now onwards). Also i was not able to solve C question , i solved A,B and D , D with difference array technique on my own.
If my account was flagged for suspicious activity or plagiarism, please manually review my submissions and account activity , and please enable my account as soon as possible.
Congratulations to the winners! Shortly you will be contacted via private messages with instructions to receive your prize.
As usual, we used the following two scripts for generating random winners, seed is the score of the winner.
nigger