Hi Codeforces!
On Dec/06/2025 11:15 (Moscow time) we will hold Codeforces Round 1069 (Div. 1) and Codeforces Round 1069 (Div. 2). Note the unusual starting time!
The harder problems of this round are based on the problems from the Final round of Yandex Cup 2025, Algorithms track, that will be held at the same time.
The problems are authored by v_vsg, heesooyaam, teraqqq, LeoPro, isaf27, elshiko, Flyce with guest problems from napstablook, sunkuangzheng, and great help from Vladithur, Dominater069, and tourist.
I'd like to thank Um_nik, Akulyat, okwedook, Merkurev, conqueror_of_tourist, Dominater069, cadmiumky, OG_Maksimchick4, Iguanado for testing the round, and MikeMirzayanov for the Polygon and Codeforces systems.
Because the official Yandex Cup Finals ends later than the round on Codeforces, the upsolving, solutions, and test cases will be closed until the end of the onsite contest, roughly 3 hours after the end of the Codeforces round. It is also forbidden to discuss the problems publicly until the end of the onsite round. Any comments here concerning the problems will be removed.
P.S. Same as with many rounds based on onsite contests, you can expect that the difficulty curve may be different from the one typical for Codeforces rounds. This is mostly connected with the limited amount of testing we can do to avoid problem leakage, and with the limited choice of problems. Nevertheless, I believe that it's better to have a round than not have one, and I hope you'll enjoy the problems!
Good luck!
Scoring distribution: you'll see in the contest.
UPD: there is live stream with problem discussions and comments here: https://www.youtube.com/watch?v=6R7iwYAXKLY
UPD2: Editorial.








Suggestion: delay the round slightly compared to the official contest. I'm totally not saying this because it'd start at 9 AM here and I wanna sleep more.
There will be problem discussions live in the second part of the Finals, so we should have the round early.
But on the other hand, this round has a great time for Chinese.
Yup It's a nice time for Chinese (16:15 UTC+8).
I have to wake up at 6:35 am for normal contest
Good Fast again
_Robi is slow
Do you guys know that KAN literally means Ears in our language.
my language too.
--CommentDeleted--
Could you please elaborate on what you mean by "different difficulty curve"?
Goodbye 2023 :<
oh codeforces round 10sixty nine :skull:
This will be my second contest. In my first contest, I was unable to solve a single question.
I got 542 rating through my first test,and I hope I and everyone can get a higher rating!!
Is it only I who feels B is tougher than C?
Wrong announcement https://mirror.codeforces.com/blog/entry/148865
B was tougher than C in Round 1068.
I agree.
True for this round. Not for 1068. B has less submissions than C
Aged well
should do more unusual start time!
As a tester, I enjoyed the round!
As a coder, I failed in this round.
Hope to increase my rating:)
what's score distribution sir ?
Perfect time for me.
Is it rated contest?
When will the score distribution be announced
What a nice time for asian!
Nice time for us Europeans too!
I got up at 6 am to do Advent of Code, then at 9:30 am I can do CodeForces. Perfect way to spend a Saturday morning!
I want to share something i feel that most of the contest that participated in the unusual time of codeforces is hard and less in rating points. do any one feel the same ?
whatever it is , we have to give ours best to it .
You're right.
Score Distribution when ?
Score Distribution when ? (2)
Directly in the round I guess :((
Am I trippin, or was it scheduled for 15:35 instead of 9:15? Unlucky contest miss :/
If it was scheduled for later, it must've been quite some time ago. A rated mirror can't be long after an official contest.
I think I found a cheater?(maybe)
SHATTA has 'wonderful' submissions.
But he is Unrated.
3rd question is easier than 2nd according to me.
yes
curious about div1 F
Goodbye 2023 revisited? I’m not saying the issues are the same, but the general contest quality seems similar. The scoreboard shows this in many ways…
Please avoid discussing the problems in public, including but not limited to this blog, until 13:05 UTC.
Bad round with reversed difficulty order and a problem solvable by AI.
the mirror of yandex cup last year was also a disaster with little time given :(
please ban this blatantly shameful cheater, once the contest is over.
flexing on linkedin
flexing on linkedin part2
his codeforces account
difficulty order disaster
Too many cheaters today, solved for 2D exceeds 1B.
First, that's not even true: 567 people in div 1 solved the problem vs 436 in div 2. 436 < 567.
Second, that does not prove cheating. There are nearly 8 times as many participants in div 2 so everything else being equal you would expect higher absolute number of solutions.
In relative terms, 83.6% of div 1 contestants solved the problem vs only 7.6% of div 2 contestants.
"You better not be speedforces" The codeforces round 1069:
Uh... it's a 2-hour round based on an onsite competition. Speedforces is expected then.
Holy f was that an Umame reference.
The best part of this blog will be all the people not discussing problems in comments!
i really enjoyed the contest..B>>C>A..difficulty order
C was quite easy for a C
I would say even A>C because A atleast makes you think something but C is like simulation. No need think just code as said.
Yes. I think too.
speedforces
It hurts when B is tougher than C.
Thought I think this comment maybe downvote a lot,I'm wondering where is the editorial.
Way too many cheaters in Div2.
T.T I should have tried E1 man, just wasted my time on D thinking its some greedy as DP n*k*k will not pass. Then I realized we can optimize as N is 1e5 but max we can increase Ai <360 times. Could not code in time. Also, C is easier than B and even A. Its just lengthy to code than A/B.
Spent my whole effort to solve four problems, failed to beat who only submitted F. =(
LOL
how to solve D1C?
Why was "Impossible" case-sensitive in 2C? I got WA test 1 by outputting "IMPOSSIBLE".
because the lower-cased "impossible" is confusing.
It's ok cuz WA test 1 doesn't give you -50 pts
upd: sorry for not reading the announcement carefully...
oh i forgot to say i was in div2
Dp works just remember that once at jth pos you give new max X then after that no need give anyone anything until its going to be new nax as you are just wasting if its not new max. Now N is 1e5 but if K<360 then the increment can be worst case like 1,2,3,4... . solve for m*(m+1)/2=360 thats max you worried about. This optimizes the dp heavily
got it. thank you bro
Same O(nk^2) Maybe some DS use to simplify the transitions
Same, anyone care to explain their solutions? I thought that it could be solved using CHT with O(k^3 log k) complexity, but seems like my idea is wrong...
what is CHT?
convex hull trick
It felt a lot like a knapsack problem.
The value of happiness rises in steps. I calculated a "profit" by takeing the increase per step times the no of ppl ahead of current index as happiness
not needed and thats why you should stop learning useless things for your rating. There are only $$$O(k)$$$ values that would have $$$b[i] \neq 0$$$ ,and overall it can be solved in $$$O(k^3)$$$.
I thought that, but didn't submit as I thought $$$O(k^3)$$$ would give TLE as k was 1800 and wasted >1hr on trying to optimize it. But realized after contest that it should work.
if you read properly $$$k$$$ was 360. So better read the problems properly. That $$$1800$$$ is sum over all test cases.
Hint: only O(k) positions are candidates that can be filled with a positive number.
i just observed that a number is useful only on the first time it appears. e.g. [2,1,5,2] can be compressed to [{2,1},{1,2},{5,3}]. reduces nk^2 to k^3. then a later number that is smaller is surely worse so reduce it to [{2,1},{5,3}]. "sub k^3" solution passes. the second number is the index
why was my submission skipped ? i didnt cheat
I honestly dint understand the wording of E1 in div2. What do u mean by uniform and distinct colours of pebbles ?
Also is it only me or was the difficulty of A-D all over the place? Like the order and level were different?
You sure you understood [A-D]? Your submissions
seem to beare AI generatedI think I accidentally used my work environment in the middle which has auto refactoring (qodana). Usually my code quality is quite shit.
I am sorry,still figuring this cp thing,will probably stick to something like vim next time.
"still figuring this cp thing"
YOU SOLVED DIV2 D IN 15 MINUTES
Advice: next time you solve problems with AI, remember to remove the input validation lines, like
in Your Submission for example. Because no fucking way you be like "Oh, I gotta make sure that the input is as described as in the input section." while you're in the middle of a live contest.
I am gonna be honest,I prefer doing this:
if(!(cin >> number)) { cout << "Invalid ; cin.clear(); cin.ignore(10000, '\n'); }
Are you saying i dont need mem safety in codeforces? Cauz i felt uneasy taking direct inputs while solving casually. Could u pls also tell more things that happen differently?? I saw a bunch of ppl submiting high density code rather than safely on yt, should i start doing that?
Chill out man, no one's falling for that.
Even if you did it for memory safety, sure, lets go with that, can you please explain how in cf div 2 1069 you solved D before C? why did you skip C when it is a rather trivial solution compared to B and definitely much easier than D.
Furthermore, why did you decide to comment so much in D from codeforces div 2 1068 — "Taigas carry chains" the time difference between C and D submission there is 30 minutes, where did you find the time to explain all your code and program a worthy solution at the same time?
I appreciate your future response. Thank you
Why do you ask me lol, Ask ChatGPT as you usually do.
Is it rated?
352230443
someone please tell me what did I do wrong in B ?
my logic -- numbers in this order: 1 2 4 5 6 8 9 10 11 12 13 14 16 17 18 19 20...... 30 32 33......62 64.... (removed 2^k-1)
if we take XOR of these numbers it would be always non zero so i partitioned the array into three parts [1....l-1] [l....r] [r+1....n] lets call them A B and C
in A and C , i wrote these numbers ,starting from 4 ,independently in increasing fashion (these wont cross 1e6)
in B for half of the numbers i wrote that sequence starting from 4 , and then those half again so that the XOR becomes 0 for [l...r] and !=0 for any other interval in B
EDIT: if B is odd , which would be >=3 , there i wrote it this way , [3 4 5 6 ..... 1 2 4 5 6.....] so basically as length -3 is even ,I handled that even part , by inserting 3 and 1,2 before each of the half-sequence starts
now in to a[l-1] in A and a[r+1] in C, I added a very big 2^k (1<<27 and 1<<28) (those would be around 1e8 )so that again XOR of any interval other than B remains !=0
Please point out the mistake , thanks in advanced, I am going downhill way too quick
what if region B has an odd length? you algorithm implies that the length of B is even (or am i missing something?)
yes so if B is odd , which would be >=3 i have handled it as well , there i wrote it this way , [3 4 5 6 ..... 1 2 4 5 6.....] so basically as length -3 is even ,I handled that even part , by inserting 3 and 1,2 before each of the half-sequence starts
forgot to write it in description ,thanks for pointing out
From what I'm understanding in your description of your algorithm, you're doing the following:
A — You start at 4, entering increasing numbers. C — You start at 4 again, entering increasing numbers.
Assuming your construction of B is valid, and my understanding is correct; what happens when |A| == |C|, where |x| is the size of section x?
What you get is XOR(A) = XOR(C)
Hence, if you XOR the entire array, which is a subarray of itself, you get the following situation.
XOR(A) ^ XOR(B) ^ XOR(C) = XOR(A) ^ 0 ^ XOR(C) = XOR(A) ^ XOR(A) = 0
Hence, in these edge cases, your algorithm fails.
Thats not the scenario..
hi , i have done a[l-1]+=1<<27 and a[r+1]+=1<<28 because of the issue you pointed out
which won't make XOR(A)==XOR(C)
lets consider the scenario, l,,x,,,r, r+1...y..C, so there will be the case where x..r,r+1..y will be zero, i.e (x,y) will become zero, you have missed the overlapping case for between B and c.
but again won't the addition of 1<<28 to r+1 , make sure that (x,y) won't be 0 ?
as there is only one number with such a big bit being 1 ?
I think i found the mistake, it is when you take a part of the second half of B and the last term from the first part, like if n = 16 l = 1 r = 16, then your code outputs 4 5 6 8 9 10 11 12 4 5 6 8 9 10 11 12, but the array 12 4 5 6 8 9 10 has xor 0
oh thankyou so much!
could you also tell your approach to problem B , I spent a lot of time over it , just to get a wrong solution ;(
when working with xor in ranges is always useful to think about the prefix xor, let pref[i] be the prefix xor of the array up to i with pref[0] = 0 then a subarray a[l:r] has xor pref[l-1]^pref[r]. Try constructing the prefix xor first. This is enough as a hint I think, if you want a full explanation of my solution just ask.
In many problems with xor in subarrays is often much simpler to only think about the prefix xor.
aah, thankyou got it, adverse effects of CP break ;(
are today div(1+2) ques are same as yandex cup 2025 finals?
Why do you keep calling every damn thing a mosaic?
is this contest rated?
Why are users still not allowed to submit their code after this contest has ended for such a long time???
Look at the announcements for the round, the problems are from a contest that is still going and they said in the announcements that upsolving wouldnt be available until 3 hours after the CF round ended
ok, thanks :)
Please avoid discussing the problems in public, including but not limited to this blog, until 13:05 UTC.
from KAN.
when will the rating changes come?
why their is 5 implemenation tag on 1069 A ?
Bad round. Anyone with a basic understanding of polynomials can solve F in less than 20 minutes. However, D and E are sufficiently difficult given the contest's results. I think C is also a boring problem.
GPT solved last div 1 task :)
maybe it used the editorial
Not surprising since it's a fairly easy problem that uses (considering the topic of formal power series) very standard, well-known ideas. I solved it faster than B or C.
How to solve D1B?
Okay, I understood, when read some submission. (The editorial doesn't have something meaningful.)
The first relatively obvious thing we need to do is to leave only prefix maximums. Let's have pairs, where second element is the position of this maximum (in $$$0$$$-indexation). $$$a = [2, 5, 4, 7, 3] - \gt d = [(2, 0), (5, 1), (7, 3)]$$$.
Let's have a straightforward dp. $$$dp[pos][last][sum]$$$ is the maximum profit, when we took first $$$pos$$$ numbers (in array $$$d$$$), the maximum assigned number yet is $$$last$$$, and in total we assigned $$$sum$$$. But we will act, as the array has size $$$n$$$, we just didn't assign anything to the rest positions. (For example, when we assigned first value $$$x$$$ to some $$$pos$$$, then the current answer will be $$$(n - d[pos].second) \cdot x$$$, since all positions to the right will have $$$x$$$ as prefix maximum.)
The first solution is to try to iterate on position $$$pos$$$, on previous $$$last$$$, on previous $$$sum$$$ and the number $$$next$$$, which we will assign to $$$pos$$$. Then the transition is $$$dp[pos][next][sum + next] =_{max} dp[pos - 1][last][sum] + (n - d[pos].second) \cdot (next - last)$$$. ($$$next - last$$$ means, that for numbers to the right the prefix maximum changed from $$$last$$$ to $$$next$$$.) This is $$$O(k^4)$$$.
This is where I finished with no more ideas.
And the very interesting trick from the submission mentioned. The value $$$next$$$ is not always $$$0$$$ or $$$d[pos].first$$$, so we have to iterate all possible $$$next$$$. But, it has to be greater, than all previous $$$next$$$ taken. We can't add one more dimension for tracking the last $$$next$$$ taken. But let's do the following: $$$a = [2, 5, 4, 7, 3] - \gt d = [(1, 0), (2, 0), (3, 1), (4, 1), (5, 1), (6, 3), (7, 3)]$$$. Now let's take only $$$next = 0$$$ and $$$next = d[pos].first$$$ (no more iterating on $$$next$$$). And this is $$$O(n^3)$$$.
DeepSeek-V3.2-Speciale solved DIV1-F
I made a submission to 2D almost at the last second, only to realize that I accidentally swapped the some of the array names. It got accepted after the fix, and now I'm sad.
It seems that many participants used LLM to solve the problem, so it still be rated ?
Trash round with boring C and F and unreasonable order of problems.
waiting for
Q: is it rated?
Can anyone help me figure out how I can memoize my solution to avoid TLE ? https://mirror.codeforces.com/contest/2175/submission/352235026
is this contest rated or unrated?
Is this contest rated or not?
hey ! can anyone confirm was this contest unrated?
Isn't it taking so long to give the ratings?
so uh I was cyan for 24 hours
just got cyan pray for me
I think that sneaky $$$\sum n \leq 10^6$$$ in d1c2 is a bad practice for a subtask problem
Why is it sneaky? The intended solution is $$$O(N)$$$ so it's not a tight constraint and if you have a suboptimal solution with a higher constant factor, TLE is a reasonable verdict.
It was sneaky only because C1 had the same upper bound for $$$n$$$ and $$$\sum n$$$. Why not just $$$n \leq 10^6$$$ in C2?
There are many, many problems that have different bounds and many that have the same bounds. You have no more reason to miss it here than to miss it in a large % of all the problems you solve. And like I said, even if you missed it, an optimal solution or one that's slightly suboptimal but with a good constant factor will still pass. It's not something that affects you unless you get sloppy with multiple things at once.
I have no problem with different bounds generally. But I would expect the bold caption "The difference between the versions" to actually mention all the differences. Mu nlog actually barely passed and it took me a minute to make linear on the contest.
The $$$\sum n \le 5 \cdot 10^5$$$ and $$$\sum k \le 1800$$$ in d1b are more sneaky.
Why weren't the cheaters banned? Please try to keep the round rated.
Well, maybe not — given the number of cheaters, the strange Div. 1 problem arrangement, and C1/2 being much harder than they should’ve been. :(
Hack #1160191 got
Unexpected verdictin Codeforces Round 1069 (Div. 1).The test case is:
Update: It has been fixed.
Will the cheaters (including those who used AI) be removed from the standings?
Hello Team, I received a plagiarism warning for problem E in Codeforces Round 1069 (Div.2). I solved the problem entirely by myself and did not share my code with anyone. I believe the similarity was due to a standard approach used by many participants. please recheck again.
Subject: Appeal regarding plagiarism flag on submission 352206874 (Problem 2175E1) — Global Rank 18 Hello. I received an automatic plagiarism warning for my submission 352206874 in problem 2175E1. I want to clarify that I did not copy anyone’s solution and I did not share my code with any participant. I also do not know the users whose solutions were matched with mine. I reached Global Rank 18, and I was fully focused on solving quickly. Because of that, my solution is short, direct, and uses a very common modular-arithmetic structure (binary exponentiation, modular inverse, prefix powers, double loops with symmetric bounds). Such patterns are standard for this type of problem, so accidental similarity is possible. Below is my exact original submission for manual review:
My code uses a consistent naming style (ab, bc, cd, de, ef…), symmetric loop structure, and a specific way of computing (kl — jk*jk + cd) % cd. These are my personal patterns, not shared with anyone. I can also provide my original local file timestamps or editor history if required. I kindly request a manual review of submission 352206874. Thank you for your time. — Nakshatra_21
going to 1700+ in just 4 contests. man you must be something "if (!(cin >> ab >> bc >> cd)) return;" take a look at this and say it is not AI generated
I wrote the code myself. Short variable names don’t make something “AI-generated”; they just make it faster to type under time pressure. The logic, the inverse computation, the power table, and the symmetric loops are exactly how I solved it during the contest. Anyone can accuse, but I’ve already provided a full appeal and I can show timestamps/editor history if needed. I trust the coordinators to review facts, not assumptions.
this was not about your obfuscated variable names, but clear AI generated input reading style.
"if (!(cin >> ab >> bc >> cd)) return;"and quit fooling around. in just 3 contests you went from newbie to expert.explain this you bloody lying idiot : you cheated from here, 352227762
You’re accusing without even checking basic facts. The submission you linked was made after mine, so it’s impossible for me to copy from it. Decide first what you’re accusing me of — AI use or copying someone else — because you’re contradicting yourself. My solution matches my own coding style and I’ve already provided a full appeal. The coordinators will judge based on evidence, not your random insults.
both have same code, it now shows that you both used AI. only AI uses :
"if (!(cin >> ab >> bc >> cd)) return;".just accept it. don't lie. your templates do not even match in same contest problems and also obfuscating using
"ab", "bc", "cd", "de"....did not help you. so stop fooling around. your previous contest submissions are also AI generated. . explain these AI generated codes of you — 351203742 — here you did not remove AI comments which clearly showsbc = n, cd = k, de = a, ef = b etcand this 351201345, why don't you just stop cheating ? post this thread if you are bragging about reaching expert (by cheating) in just 4 contests.ab, bc, cd, de .. xy, yznice obfuscation strategy.You’re mixing up accusations without understanding anything. First it was “AI”, then it was “copying someone”, now it’s “variable names”. At least decide what your story is before spamming nonsense. The submission you linked was made after mine, so copying it is literally impossible. And my previous submissions use the same style because — surprise — that’s actually my style. You are trying to force a conclusion without a single consistent fact. I’ve already submitted a full appeal with all details. The coordinators will decide based on evidence, not on whatever theory you invent every 5 minutes
Silence, AI clown!
Hello, I am requesting clarification regarding a plagiarism flag.
Handle: yashcoder123 Contest: Codeforces Round #1069 (Div. 2) Problem: 2175E2 Submission ID: 352221532
I received a warning that my solution coincides with several others. I wrote my code independently and did not share it with anyone. I believe the similarity might be due to common templates / similar logic used by many participants.
Thank you.
If you want to prove you don't cheat,I advise you to write a blog to show why you are not a cheater.
Just give a comment here may not draw admin's attention.
And on the other hand,everyone has the ability to write comment to saying,"I'm not a cheater and you gave me the wrong flag."
So if you are truly not a cheater,just write a blog to show the difference between your code and others'.
thankyou very much
And, with all due respect, your code really looks like it was written by AI.
wow man , you solved F so early and changed from Union Find to Segment Tree in less than ten minutes .
you were so hasty to go up in standings you might have missed removing AI comments my friend, 352207103, 352209160, 352229985. and also this was not due to common templates or similar logic. but AI generated codes. ya man going rank 4000 to rank 150 in just 20 days is no less feat to achieve. you must be prompting hell out of AI.those were vs code comments
yes VS code does the AI generation , and you shamelessly defend it. grow up you cheater.
you write code by yourself and VS Code does the comments. wow !!cheater just shut up and don't lie .more you lie, more you get exposedhttps://mirror.codeforces.com/contest/2175/submission/352221009
Why wasn't this cheater removed from the scoreboard?
He even achieved Rank 49 in Div.2!
Too many cheaters and Nobody disqualify them!
Hello Codeforces Admins(@KAN,@MikeMirzayanov), I am writing regarding my skipped submission "https://mirror.codeforces.com/contest/2175/submission/352219881" for the problem 2175D in the contest Codeforces round 1069 (Div2),beacuse of which whole contest was skipped. After reviewing the matching submissions , i think i have done "unintentional leakage", though i did not copy from others and one of two users "elon_fan" has committed that he has cheated. During the contest, i wrote my solution in online compiler OneCompiler. I was unaware that these platforms index code publicaly by default. I believe that this caused my code to be leaked and found by others, resulting in matches. I apologize for this oversight and violation of rules if any done by me. I will from now use local IDE that i have (Clion). I respectfully ask that you consider this explanation. I did not intend to cheat, but i accept responsibility for using an insecure tool.
Hello,
I would like to clarify the situation regarding my submission 352216919 for problem 2175E1.
Due to the unusual timing of this contest, I participated in Division 2 quite late. Under time pressure, I referred to a publicly available resource to correctly implement modular exponentiation for large numbers in C++. Specifically, I used the following reference:
https://stackoverflow.com/questions/2207006/modular-exponentiation-for-high-numbers-in-c
I did not copy any code from other participants. Any similarity with submissions from other users is purely coincidental and arises from using a standard, public implementation. Notably, my submission was made before Hemanth2005 's submission, which shows that the similarity could not have arisen from copying them. I rewrote the solution in my own style, and I did not access anyone else’s submissions.
I hope this clarifies that my work was independent, and I request reconsideration of the flag on my submission. Please let me know if any further details are needed.
Thank you for your understanding.