
Hello Codeforces!
The series of Educational Rounds continues thanks to the support of the Neapolis University Pafos.
On Apr/21/2026 17:35 (Moscow time) Educational Codeforces Round 189 (Rated for Div. 2) will start.
This round will be rated for the participants with rating lower than 2100. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest, you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally.
You will be given 6 or 7 problems and 2 hours to solve them.
This round is based on problems from the 2026 Tula Open Programming Championship.
The problems were invented and prepared by basalov_yurij, BledDest and me.
I would also like to thank the other problem authors of the championship: ashmelev, Galina_Basalova, Rudom71 and my-maxi-box. Thank you, it is a pleasure working with you!
Many thanks to the round coordinator, Ivan BledDest Androsov, for improving the quality of the problems and helping with their preparation.
Big thanks to our testers: 300iq, awoo, l-_-l, FairyWinx, Kirilliym, soup, Minder, KIRIJIJI, pusheen_1024, annasa, Sayleyd, dan00ile, egor4444ik, slash0t, tic_genie, alexanderanchishkin, vkotov, adedalic, Neon for their valuable advice and suggestions!
And of course, huge thanks to Mike MikeMirzayanov Mirzayanov for great systems Polygon and Codeforces.
Our friends at Neapolis University Pafos also have a message for you:
CSAI: First admission deadline approaches — April 28, 2026.
Apply for the BSc in Computer Science & Artificial Intelligence at the Neapolis University Pafos. Up to 40 full scholarships, provided by the JetBrains Foundation, are available this year.
Key Dates
- Application Deadline: April 28, 2026, 11:59 pm UTC
- Mandatory Entrance Test: May 3, 2026
A great opportunity: ACTS 2026.2 Camp
To improve skills and prepare for intense programs like CSAI, we encourage applying for the ACTS 2026.2 Camp in Germany (July 10-20, 2026).
- Tracks: Competitive Programming and Software Engineering.
- Registration Deadline: April 25th.
Ready to advance your coding journey? Join a leading computer science community today! Apply now and visit our dedicated pages for more details on how you can get involved.
Good luck to all the participants!
upd: The editorial can be found here.








Auto comment: topic has been updated by FelixArg (previous revision, new revision, compare).
Manifesting +ve delta for most.
Not that 6 — 7 problems joke again.
it's been like this for years youre paranoid
hope to become expert this round
I wish you success in becoming Expert
I wish it a successful contest better than edu185!
edu185 is the worst edu I've ever participated.
It seems that the worst edu has turned to this one:)
Hope to become candidate master!!!
Congratulations! BTW Kuro_neko ORZZZZZZZZZZZZZZZZZZZZZ
edu plz save cf again
Fingers crossed
if I solve 2 problems I celebrate, if I solve 3 I check if it`s a dream.
Solving 3 problems in an edu contest is not that hard — an Edu contest is as easy as a Div.3. I think even 800 ratings users can do this. Wait, you're 500? Nevermind
an Edu contest is as easy as a Div.3It even says — "Rated for div2"...
Just comparing a subset of problems is not the criteria. You could have argued that an Edu Problem A can be compared to Div3A and that would have made sense. And no way, Problem C of both the contests can be compared.
if i solve 3 question it soo good for me but if i have solved 4 question it will dream
hope dream come true
hopefully I don't reach newbie again after this contest
excited to try it out ;D
Why are Educational Div 2 contests turning into Div 3 day by day?
Div-2 contest with Div-3 leaderboard loading i reckon
I hope I can solve min 2 problems today.
queueforces
The contest didn't go very well, partly because certain key points need to be clearly highlighted so that participants notice them, and partly because the instructions were worded incorrectly. Please correct this.
The math and the overflow problem in problem D, also the geometry in problem E cooked me so bad. Not really enjoying this round.
I feel this..I kept getting WA on test case 6 and wasted 20 mins wondering if my logic was shit, but turns out it was an overflow error. Stings, stings bad
can i get some hints for D
prefix-xor have 4 value : 0 , 1 , i , i + 1
The (above) hint is already solid! I did not know the prefix-xor property — so please prefer that.
I based my solution on even odd pairs. XOR is commutative so think along those lines. What can you pair, what does each pair amount to, how many of those pairs must you take for overall XOR value to be 0
xor(r)=xor(l-1) where xor(i)=xor sum from 0 to i. Also, prefix xor can have only 4 values: 0, 1, i and i+1 . For i and i+1 -> you need to work out some cases, and you will find this won't be valid for a range which have a xor sum 0 (you can't make the xor sum equal while keeping l<=x<=r). For 0 and 1 you check the count of mod values 3 and 1 in the range respectively.
for D i somehow completely forgot that (a * b) mod c is the same as ((a mod c) * (b mod c)) mod c and used 128 bit integers to compute a * b, wtf is wrong with me
For E i thought of doing hexagonal packing. We can find the nearest circle centre and check if current point lies inside it. Hexagonal packing has ~90% efficiency, since we are forced to only take integer point, i think it would drop to ~89% which problem asks. I couldn't get through the rounding issue though.
I had my WA2 on
h = ceil(sqrt(3) * r + 5)which gives good enough precision when r is big, but breaks when r is small. I've just removed +5 and it worked /shrug/How E? I can only solve if the percentage is $$$78.5\%$$$ instead of $$$89\%$$$.
hexagonal packing
thanks
hexagonal packing with integer centre would be ~89%
A and B is more like GuessForces. On the other hand, C is great. In fact, I think this is the best C I've ever met.
yes B was way harder for me than C
there is a solution to A
let y/x be d
y = dx
a number smaller than y but divisible by x can be written as dx-x or y-x
numerator(z) = dx-x (because y-x will always be a multiple of x if y is a multiple of x and greater than x+1) denominator = x
(dx-x)/x = x(d-1)/x = d-1 which means dx-x will always be a multiple of x now let's check the second condition, which is "y is not divisible by z"
dx/dx-x dx/x(d-1) d/(d-1) and we know that 2 consecutive number have hcf of 1, so remainder is not 0 at all
thus we come to conclusion that, z = dx-x, or y-x
but we know that x<z<y, so if here our z or y-x , is not greater than x then it is breaking the order rule, so basically it isnt possible when y-x <= x or not greater than x
and our final solution is
if y-x >x yes, else no
so i dont think A was guessforces
E was worst experience ever
For F how do we compare 2 strings in less than 0(N). I mean we can use hashing but that gets hacked so what's the other way?
Use a randomized hash or suffix array + LCE but randomized hash is easier
Perhaps you can use four-modulo hash.
UPD: its also been hacked :(
StarSilk still got hacked despite using randomized bases :)) I guess modular hashing alone isn’t enough.
Problem $$$E$$$ is cool. My solution:
The essence of this problem is that we need to use circles of a fixed radius to cover the entire plane such that the coverage exceeds 89%.
A simple construction is to place circles in a regular grid:
$$$x = i \cdot 2r, \quad y = j \cdot 2r$$$
However, this results in a coverage fraction of $$$\pi/4 \approx 78.5\%$$$, which is insufficient for the required 89%.
A better construction is a hexagonal-like tiling using integer grid approximation:
For odd $$$i$$$: $$$x = i \cdot \sqrt{3} r, \quad y = 2j \cdot r$$$
For even $$$i$$$: $$$x = i \cdot \sqrt{3} r, \quad y = (2j+1) \cdot r$$$
This arrangement ensures the circles touch but do not intersect and achieves a coverage fraction higher than 89%.
Coverage Analysis
$$$ \pi / (2 \sqrt{3}) \approx 90.7\% \gt 89\%$$$
Implementation Strategy
This avoids enumerating the entire grid and works efficiently even for large $$$n$$$.
Hence, this construction guarantees enough coverage.
I've only seen hexagon coordinates used in some real-life navigation cases (see H3), and it seemed extremely not-useful for contests, but this problem is a real good application. And indeed not obvious why it should be like that from the first look, but then the math mathes out.
Best problem of 2026 I've solved so far! Not even worried about losing the rating
Had a solution to E that requires no randomization (aside from that which is given to us in the input generation :)).
Start by approximating the bounding box as being between the bottom left corner and top right. Then just make the direct hexagonal arrangement in row order and discard all circles that don't contain anything.
Hexagonal arrangement covers ~90% of the box. Every point is then uncovered with probability $$$\leq 0.1$$$. Using the Normal approximation for Binomial random variable then yields that the probability of failure (i.e. at least $$$1101$$$ uncovered points) is on the order of $$$4 \cdot 10^{-4}$$$, which (with 40 tests) has an overall success probability of just under $$$99\%$$$.
That being said this might be one of the worst problems I've seen on a contest — completely unreasonable to expect contestants to prove that hexagonal covering actually covers 90% of the grid and hence this degenerates to a boring knowledge test/implementation task.
I made video editorial for the key idea behind D. Exceptional Segments.
Highly recommend using Geodeb library for geometry problems like todays E!
This seems fun. Did you make it?
No, it was made by kalinov: https://mirror.codeforces.com/blog/entry/70330
Why do unofficial contestants like Nachia appear in the official leaderboard?
QAQ I don't check ranges of the data in D. I'm so stupid.
I actually struggled more with the logic on B than C. I reached my 100 day streak today. Thanks for the round!
I wasted 30 minutes on problem E because I got WA just for having trailing spaces at the end of the lines.
Why so much downvotes?? It was a good contest indeed.
Why can't I hack submissions on problem F?
Weirdest contest ever, should have unrated
Possible idea source of E: https://www.youtube.com/watch?v=hGa8_P8X3yY
Shouldn't implement it on an Edu.E ...
Problem E is the worst one I have ever seen.
Problem E: WA on test 36!
Sometimes it's desparate as well even knowing $$$\dfrac{\pi}{2\sqrt 3}$$$
Please ban cheaters Mostafafied and moh-kaz333.
Problem E:
1. https://mirror.codeforces.com/contest/2225/submission/372033090
2. https://mirror.codeforces.com/contest/2225/submission/372034904
Problem G:
1. https://mirror.codeforces.com/contest/2225/submission/372048258
2. https://mirror.codeforces.com/contest/2225/submission/372043513
Their code is exactly the same.
i genuinely don't know why this got downvoted to hell, it was your typical div 2 contest. people care too much about rating.
My personal opinion:
The core idea for Problem E is not original to the author, it was copied from other sources. In other contests, this would result in the contest being unrated and the author being blacklisted.
I know this is an Edu round, but that doesn't mean you can directly copy a template problem of a difficult(ad-hoc) algorithm;This is merely testing who is better at using search engines.
Problem F is a standard SA template problem.
what do u mean by SA template problem?
I solved all 7 problems but got hacked because I used hash in F.
The only chance to get grandmaster for me gone.
Only rk 7 instead of rk 1 cuz hack.
Only got +227.
I hate hash.
when will the ratings be updated ?
I think it will update about 10 hours later.at about 24:00 (UTC+8)
Why so late
because it is educational round.almost all educational round will update rating after its end about 24 hours(just for example,an edu round end 2026/4/1 00:35,its rating will be update at about 2026/4/2 00:35) .this regularity might not so correct,its base on my view.but if the system test be quick, rating might update earlier.
Ohh i see
when I solved A to D, I know I have chance to get my rating up, but when I readed E, I know I'd better go to sleep(I'm in china exactly midnight when I participant the contest).
True.
so true XD.
Is hashing even suited for problem F? I used 2 moduli hash (as suggested in editorial). Still got hacked by Sugar_fan. Like is Z function the only suggested method for this, though I commonly used it but was feeling petty for my Hashing template left unused since long?
Update: Should we be careful in choosing the primes to prevent anti-hash hacks? I used random_generator() and got AC.
To avoid being hacked, you should use random bases. Using any number of bases and moduli with all of them fixed can still be hacked.
Yeah, it worked. And yes, the number of moduli doesn't matter since 4 modulo hash also got hacked (surprisingly).
CF Rating update time nowadays:
is not it rated?
Till now, it is rated. Since there were many hacks on problem F so, it is taking time for system testing (I guess).
Is this contest rated ??
is this contest unrated ?
How am I going to get rated ? Because it has been nearly 24 hours since I participated in this contest, but I still haven’t been rated yet (I solved one problem)[contest:189 div 2]
You will get rated when they apply the rating change on this contest (sr for bad english)
Just wait. Ratings change of edu rounds is usually slow
today, codeforces mailed me that my solutions for this contest are skipped because structure of my code looks same as some other candidate, i didnt copy any code from anyone, im new to codeforces , hence reading editorials may be i unconsciously wrote in same style but its my own code, i solved on my own.
please restore my solutions as i deeply respect codeforces rules . it was my second contest and attempted it with so much courage and energy.
Hello Everyone, I got a plag for the problem E(covering points with circles) . I really surprised by seeing the solution. It similarly matched but I don't even understand how this even happens. Let me tell my approach for this problem and share the screenshots of my coding style. Due to this it showed that I am out of contest.
Based on the problem statement my understanding of the question is
We need Place circles of radius r with integer centers, non-overlapping (may touch) Each circle must contain ≥1 given point Cover ≥89% of all points Points are uniformly distributed in a rectangle whose area ≥ 10 × circle area
Since points are uniformly random, the fraction of points covered ≈ fraction of the plane covered by circles. We need ≥89%. So I thought that hexagonal packing is better approach.
So, my intuition is rows at y = j·d_v, even rows have centers at x = 2r·i, odd rows offset by r (so x = 2r·i + r). For non-overlap, adjacent-row neighbors must be ≥ 2r apart: r² + d_v² ≥ 4r², so d_v ≥ r√3. So,For each point, we need to find its nearest hex lattice center (4 candidates — floor/ceil of row and column indices). If it is within distance r, we should mark that center and need to print all marked centers. And the time complexity for this is O(n). So, I don't know why I faced plag for this. I did it on my own and I really can't understand why this happened. So, because of this will my rating and account will be affected? Or else will there be any further enquiry? Please restore my solution as I deeply respect codeforces rules.
Hello, regarding the plagiarism warning for 2225E: both referenced accounts belong to me. I submitted the same solution from another account to check whether it would be accepted before submitting on my main account. I understand this violates the rules and I won’t do this again. Sorry for the issue.
its still cheating , whether you do it again or not.
Of course, you’re right. It still a rules violation.
Hi first time getting flagged here but I'll try my best to explain my thought process for problem E . I used hex lattice packing w random offset to maximize coverage. This is a standard geometric construction for covering points, it naturally leads to similar coordinate transforms and local neighbor checks, which may explain the resemblance to other submissions... also used a personal template which used a fixed seed for randomization that I use (mt19937 rng(Leet)) generally in practice. I use sublime text as an ide, pc's too potato to handle both my browser and vsc. I did not copy another participant’s code during the contest. I will be more careful to ensure complete independence and perhaps employ other concepts during future contests. 372019544
@psgawa is it still possible to hack the solution of F if we use single hashing with modulo as 2^61-1 and using randomized base ??
A random base is enough to avoid being hacked.
Moreover, you shouldn't use
time(0)as seed. It uses seconds as a unit and may be hacked by enumerating the seed.But Starsilk also tried to use randomised base ,still got hacked:(
He got hacked because he used
time(0). My last comment explained why.Thanks for your help :-)
I was flagged for plagiarism in 2225D, I think this is a mistake since my solution doesn't match with those flagged.here is the link to my submission :
my submission
some of the other flagged ones are as follows :
flagged 1
flagged 2
flagged 3
flagged 4
flagged 5
None of these submissions match my code or structure completely. flagged 4 is not even cpp code. I believe this is a mistake and request you to please verify and correct this mistake.
FelixArg, BledDest, basalov_yurij, MikeMirzayanov
That's exactly right! I also received a warning from the system, but after taking a closer look, I realized my code isn't similar to theirs.
I think the solution to this problem is pretty straightforward, so everyone used the same approach. That's why, under the syntax tree, everyone's code was deemed identical. The underlying logic of the code is the same—namely, the problem-solving formula we’ve developed.
Subject: Regarding plagiarism detection on problem 2225D [Submission: 372013367] Dear Codeforces Team, I hope you are doing well. I am writing regarding the plagiarism notice I received for my submission to problem 2225D (Submission ID: 372013367). I would like to respectfully clarify that I solved this problem entirely on my own. I did not use any unauthorized resources, nor did I share my code with anyone. The approach I used is based on a well-known mathematical property of XOR prefix sums, specifically the pattern involving ( k \mod 4 ), which is commonly used to optimize XOR computations. Because this technique is standard, it is possible that my implementation appears similar to others who applied the same logic. Additionally, I used a
std::mapto maintain frequency counts and iterated through the ranges ((0, x-1)) and ((x, n)), which I believe is a natural and straightforward approach for solving this type of counting problem. I take the integrity of competitive programming very seriously and always strive to follow the rules of the platform. I kindly request you to review my submission again. I am fully willing to explain any part of my solution in detail if needed. Submission link: https://mirror.codeforces.com/contest/2225/submission/372013367 Handle: shubhachakma Thank you for your time and consideration. Sincerely, Shubha ChakmaHello FelixArg BledDest basalov_yurij MikeMirzayanov Please read full
This evening, I got shocked after getting plagiarism mail after giving 190 contests on Codeforces in this contest in question D(Exceptional Segments).
Just want to put some points from highest to lowest priority: - I took the idea to solve the subproblem of this problem from blog: https://www.geeksforgeeks.org/dsa/calculate-xor-1-n/ which does not violates the rules of codeforces. - It is stated in the mail that solution with ID: 372046384 is matching with others. But this solution of mine was not even accepted. The accepted code is with ID: 372047912. - I was already having a pathetic contest(solved C problem with a lot of struggle) and was already expecting a big negative delta then for which purpose I will cheat in problem D !!! - I code on antigravity code editor which gives some free credits of claude opus. The moment I got solution in my head with help of that blog. I directly explained the solution to my inbuilt claude and it wrote the solution. Now I don't know how the heck it wrote wrong modulo value in it's solution due to which I got that wrong ans on pretest 4 (the code which you caught). But quickly I caught that thing and changed modulo value then submitted and it got accepted(there is nothing said about this code in your mail). - Never thought that after genuinely grinding through all these years and transitioning from an average student to a CM and not stopping even after reaching CM (most of the Indians stop) would later result me to such a rubbish plag tag :) **** MikeMirzayanov please look into my matter as fast as possible. If you want any further proofs then ask me I am ready to cooperate.
I think I know why.I would't use AI translator anymore....
i am writing an appeal for the warning for submission of D problem.. I checked the matched submission that were given to me.. most of the solutions didn't match with my submission.. that is very disappointing for me for such a contest as i am new to competitive programming as well as very demotivating for me.. Please check out the matter my submission: 372032649 for 2225D.
I got a plagiarism on my solution, and so did many other people, even though the solution to the problem was knowing the period of the function and being able to write two formulas. https://mirror.codeforces.com/contest/2225/submission/372036971 the logic of the solution is the same for everyone all you had to do was calculate when XOR on the prefixes gives 0 and when it gives 1 and add up the number of variations. The whole problem is solved in 4 lines, although there are differences in the codes of those who are suspected of cheating. The question arises: what is the point of checking for plagiarism on a problem that can be solved with two formulas? https://arsslenidadi.medium.com/mysterious-pattern-with-exclusive-or-xor-sum-11f154d0f763 Here's a publicly available article that describes almost the entire logic of the solution. It also describes when the XOR of subsequent elmentors is equal to 0 and when it is 1.My solution was not plagiarized like many others, and the logic behind everyone's solution was similar, although my function is quite different from the others I saw.Thank you in advance for reading and sorry for my bad English. Please remove the wrong verdict of my decision.
Sorry that my code overlapped with another. I am trying not to repeat this anymore
Nice problems
Dear Administrator,
I am the author of submission number 372015167 for problem 2225D. I am writing to appeal the decision that my solution is highly consistent with many other solutions.
My actual behavior I solved this problem independently. I did not copy anyone else's code, nor did I share or publish my code before or during the contest.
Key evidence: Two submissions flagged as "similar" are visually very different Among the submissions listed as coinciding with mine is 372011294.
Anyone can visually compare these two submissions: - Mine: 372015167 - Flagged as similar to mine: 372011294
These two submissions are clearly very different in terms of variable naming, code structure, indentation style, and implementation details. They do NOT look like copied or leaked code.
Yet the system's AST-based similarity detection still marked them as "similar."
The only logical conclusion This contradiction actually proves the key point:
Any independent solver who finds the optimal solution will naturally end up with nearly identical core logic — not because of cheating, but because the problem leaves no other reasonable way to write it.
I am willing to provide additional explanation of my solution or a handwritten derivation if needed.
Thank you for your time and understanding.