Hello, Codeforces!
I am exhilarated to invite you to participate in Codeforces Round 1084 (Div. 3), which will be held on Feb/27/2026 17:35 (Moscow time)! You will be given $$$7$$$-$$$8$$$ problems to solve in $$$2$$$ hours and $$$15$$$ minutes. All problems were authored and prepared by me.
The round will be hosted by rules of educational rounds (extended ICPC). During the round, all solutions will be judged on preliminary tests. 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. There will also be the usual penalty of 10 minutes for each wrong submission.
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:
participate in at least five rated rounds (and solve at least one problem in each of them)
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).
Please note the rules restricting AI use. All violators will be sent directly to cry's basement, which does not have any air.
I would like to thank:
cry for his
Clash Royale addictionamazing coordination.Vladosiya for translating the statements into Russian
omeganot, awesomeguy856, catgirl, __baozii__, Intellegent, and sammyuri for crimson testing.
temporary1, rhombus, -firefly-, Proof_by_QED, BiggestOtaku, C0DET1GER, jay_jayjay, turska, Friedrich, Broder, efishel, and amsraman for amber testing.
conjectureguy, SpyrosAliv, wuhudsm, CutSandstone, tin.le2, Edeeva, TheYashB, and Vikas_soni for magenta testing.
Ermiooo159, Argentum47, Eikyu, simplelife, nimoxide, akane646, chromate00, mathtsai, and Faisal-Saqib for cerulean testing.
nik_exists and ALnQ417 for turquoise testing.
aahceL for veridian testing.
DraxLab for silver testing.
MikeMirzayanov and KAN for Codeforces and Polygon.
Good luck to everyone and I hope that you enjoy the problems!








Auto comment: topic has been updated by AksLolCoding (previous revision, new revision, compare).
Dear MikeMirzayanov and AksLolCoding,
My disabled account is HuuBach, and the email associated with it is bach123456789101112131415@gmail.com.
I am writing regarding the recent ban on my account related to Codeforces Round 1084 (Div. 3)
I would like to acknowledge that I violated the contest rules. I fully understand that Codeforces enforces strict standards to ensure fairness for all participants, and my actions were inconsistent with those standards. I take full responsibility for my mistake.
I sincerely regret this behavior. Codeforces has been an important platform for my learning and development in competitive programming. If there is any possibility of reconsideration, I would be very grateful for a second chance. I am willing to accept any reasonable conditions, such as rating reset, removal of affected results, or probation.
I assure you that this will not happen again, and I will strictly follow all contest rules in the future.
Thank you for your time and consideration.
Best regards, HuuBach
hopefully this contest will make me nut
As a tester, I can confirm that this may or may not happen.
wishful thinking
hopefully I will make this contest nut
As a second time tester , i wish you 2 * lot of positive delta
I hope this contest will be rated for me :3
Ok confirmed! this contest definitely going to be rated ;)
NO! I got to expert, now I can't do this contest :(
you should still do it, it'll just be unrated
Good luck on increasing your contribution...
😭
Auto comment: topic has been updated by AksLolCoding (previous revision, new revision, compare).
As a tester, gud luck and have fun.
As a tester, I will become a Magenta Tester next time
As a tester, I hope no problem spikes your cortisol.
As a tester, this contest is so good that I've took out a 1e9 dollar loan to give to AksLolCoding in order to thank him for bestowing such beauty on CodeForces.
I’m excited to participate in the Dev 3 contest.
me too...
Me with my M265 Oxygen tank:
i hope this contest will go good
Good luck on Div 3!! Special support to testers! Show some high performance tomorrow, guys. May the force of competitive programming be with you! Don't pay attention to my avatar!!!
Hoping this div-3 will be exciting! Good luck to all..
I have but one thing to say AksLolCoding
Div2F(3).pdf
C is a trash
you are commenting in the wrong blog
bruh..... C is good problem, if you mean Codeforces Round 1083 (Div. 2), even if i don't able to solve it. Try to motivate the setters, even if one problem bad. Don't let one problem change your opinion about the round.
Idk, I feel like div2 F was nicer (3)
its so peak
Silver Testing..? Faaaaah..! By the way nice initiative to support new programmers and involve them in official tasks. Giving testing responsibility is a big learning opportunity. Keep it up!
One contest we had unrated testing :/
AksLolCoding did you use div2 F(3).pdf?
as not a tester I can say that div2 F(3).pdf was the best problem that AksLolCoding has got
404!
As a tester div2 f(3).pdf
3 contests in a row.
i hope, i will become expert again in this contest
Hedllo!
Codeforces Good!!!!!!
codeforces ba pesh!
As a tester, gud luck and have fun
As a participant, I hope this contest will be amazing contest AksLolCoding :)
abaydos
Thank u AksLolCoding for DIV 3 and thank for all participants IS cry's Clash royale addiction so bad
Also GOOD luck for all in DIV 3 !! ^_^
Hey Guys, I am new to codeforces. Can anyone help me in codeforces?
Welcome! Codeforces is an excellent platform for practice. To get started, solve problems from the archive (start with those with a low rating), participate in Div.3/Div.4 rounds, learn to analyze other users' solutions, and don't be afraid to make mistakes. Study basic algorithms and data structures to improve your rating.
Key Tips for Beginners: Start with the "Problemset": Choose problems with a specific difficulty (e.g., 800–1000) and sort them by the number of solved tasks (from most to least).
Participate in Rounds: Don't be afraid to take part in rated rounds (especially Div.3, Div.4, or Educational), even if you only manage to solve one problem.
Upsolving: After a round, be sure to read the Editorials and solve the problems you weren't able to finish during the contest.
Master the Basics: Understanding fundamental algorithms (sorting, binary search, basic data structures) is more important than knowing complex, advanced techniques.
Language Options: Problems are available in both Russian and English.
Good luck with your training!
Thanks.
Bro dont use LLM
"participate in at least five rated rounds (and solve at least one problem in each of them" what does it mean? i created this handle when i was in school but now i am in university that's why i am fully focused on coding. i didn't participated any contest earlier. will i be rated if i attend this contest?
You will but you will not be concluded into the trusted participant list until you meet the constraints.
abidhasan11
I hope this Div3 allows me to cross 1000 rating,currently 850
as not being a tester, i can confirm that this is codeforces.com
Hi,I have used AI in some of my submissions during contest, can u help me to disable my account?
I want to start everything from the beginning with honesty
Going to participate after the long break
Good luck to eveyone on this round!
Waiting for fair performance from all participants.
easy question, easy question, easy question, WHAT THE FUCK is that question, I feel after banging my head and getting -4 I am starting to hate the concept of Portals.
Second that.
The solution that I could think of was a long if else construction or rather like some sports-tournament match table... like
Finally to wrap it up... check -> if this finalist could be reduced to a lexicographically smaller value using either of those two operations.
Checking the Tutorial as I speak... (curious 3000)
The solution hinges on the fact that the array inside the portals and the combined array to either side act as separate entities. Since each element is unique, we should just rotate the inside array until the smallest element is at the front (call the smallest element a).
Then shift all elements outside the portals to the end of the array until the stuff in front of the first portal is all less than a.
364713283 can you check my submission i am kind of doing same
Romantic color name and interesting basement! good luck and enjoy the round
why so many 67 in this contest ToT
Can any1 give the hint for E
there are 2 "cases", think why and how alice can force something into a position that when touched again will result in it being impossible for the array to become nondec, and in the case it is not possible, think of a pattern that every element must follow
i thought of that
if arr is sorted after expanding to all prime nums -> bob wins if a num has more than 1 prime divisor -> alice wins
if after expanding all nums's prime divisors , if divisors are in dec order for eg ( 5 9) -> alice wins
else bob wins (keeping in mind arr is in inc order)
but stil getting wa 2 :/
then its correct? well you also have to check that the array is intially sorted but yeah
i checked it too
i think some edge case i am missing..
missed E slightly man..
I think your factorization code is slightly off. Consider the example 1 4 8 4. Bob should win this, but I think your code will return Alice?
Edit: I just looked at it again and I take it back, it seems right to me. Sorry about that
its still giving bob
i dont know what am i missing
will try to figure out :))
thanks!!
Think of this test case 1 49 8.
Your code will give answer as Bob , but in reality Alice won the game.
I think you just wrote till if distinct prime factor exist or not. But I guess we need to check the order of max prime factor of each element. I am also stuck with you :(
Imagine [2, 1]
your code fails for testcases like: 1 37 3. since no j divides 37 in loop it exits and the condition for checking max fails you need to check whether it's following non-decreasing order separately
if array is sorted, Bob wins.
else if there is any number in an array which has 2 distinct prime factors Alice wins
else if the array is sorted based on prime factor Bob wins
else Alice wins
I'd like to express my thougrs in chinese because my English is not good. Bob能赢只有两种情况:1.一开始就赢了 2.a[n]中所有的元素都是p[i]**k[i]的形式(p是质数,k是整数),并且i<j时,p[i]<p[j].不知道我说得对不对
Ignoring the obvious case where the array starts sorted, Alice can pretty much guarantee a win on her first move in nearly every setup.
I'll leave it to you to figure out what the criteria is :)
Good contest. Stuck on D.
it was just mostly implementation
we can observe that 1 2 3 | 4 5 6 | 7 8
we can only play with [4,6] segement differently
and solve the combine segment of [1,3] + [7,8] differently
with checking with the first element of the middle segment
Problem $$$F$$$ is implementation hell, but a good problem though.
I wasnt able to think any logn implementation, i solved(worst solved) precalculating answer for every reactivity and then O(n) calculation again with shop particle and check it with precalculated (anyways precalculation is N2 and again N2)
F was too implementation heavy... though I could code up most of the approach imo, couldn't finish in time
364713283 why this is giving WA my approach -> there will be 3 cases 1-> 1...P.. P .. 2-> ...P..1..P.. 3 -> ..P...P..1 in 2nd case we have no other choice other than placing 1 at top and maintaining order of other element in 1st case elements between P's we place min element just after 1st P and compare right of 2nd P to first element after 1st P i.e px + 1
no cases bro, imagine as pre_mid_post and rotate mid till min comes first and then just adjust pre values to post by checking if val < min_from_mid
I loved the contest, for the first time I was able to solve till E problem in Div3.
Thanks AksLolCoding for such an amazing contest <3.
I like F,it's also very suitable to be divided into 2 parts,with or without queries.
rank 4 for a reason
My thinkflow for problem E is as follows.
My first observation was, if there exists an even number that is NOT a power of 2 (2^k), Alice always wins. In this case, there will always be an odd prime factor, let's call it 'x'. Alice simply waits for her turn, factors that number into x * 2^m, and arranges them as [x, 2^m]. On her subsequent turns, she continues to break down 2^m into [x, 2, 2, 2, ...]. Bob loses because the sequence is no longer non-decreasing (since x > 2). Since Alice goes first, she can always force this strategy => Guaranteed win for Alice.
Therefore, only two cases remain: all odd numbers, or odd numbers + even numbers that are powers of 2.
If the array is all odd, Bob still loses if the initial array is not non-decreasing (i wont go in details)
=> In short, the only way for Bob to win is if the array follows this pattern: [1, 1, 1 ... 1] (a sequence of 1s, or empty), followed by [2^k, 2^m, 2^n, ...] (must contain at least one element of form 2^k), followed by [a sequence of increasing odd primes] (or empty).
And then, I just realized I was wrong. There are also numbers like 3^a, 5^b, etc.
The array must actually follow this format: [1s], [elements of form 2^a], [elements of form 3^b], ..., [elements of form (max prime <= 1e6)^z]
In other words, if we transform each element into its "prime base", the resulting sequence must be non-decreasing.
There is some gap in fairness of rating function. If the contest is rated till 1599, and guy with 1590~99 takes part and achieves top 100, they can reach up to 1700. But, people with rating 1600~50 loose these chance to +ve delta.
I think, here solution is, rating increments above the threshold should be capped (say threshold + 50).
if current rating is 1590, and +ve delta is 150, then you should get min(threshold + 50, current + delta).
By adding such capped delta, we can bring fairness to people who are just above threshold and marked unrated.
I am not saying it because this is unrated for me, but I was having discussion with my friend and we both had similar opinions. PS : Peace.
Let him find his happiness; he’ll return to his brothers soon enough
Hello
Does someone know why when we triyed to hack, they said "Page is temporarily blocked by administrator" ?
F felt like two big problems , combined into 1
I am scared of any question which has the word permutation in it. Couldn't solve D, tried E but sucked.
same
aaggh!!
Damn the python dict hack had to ruin it
Authors got hacked on F. Please adjust your code so unexpected verdicts go through.
Fixed.
zalupa
Thanks to all who made this contest. I was trying to get back to CP and this was a pretty decent contest. Thanks again for boosting me and keeping me encouraged.
E was peak
Can anyone tell me why i am getting wrong on test case 2 in F?
code
Hello, I participated in the this Div. 3 contest 1084, but it seems that it was not counted as rated for me. As far as I remember, I did not select the “participate as unrated” option. However, after the standings were finalized, my rating did not change. Could someone please check if my participation was marked as unrated by mistake? Sorry if I am missing something, I am still relatively new to contests.
everyone's rating haven't been update.
Wait for a few hours rating will show up in your profile later today.
It usually takes a few hours for codeforces to update ratings of the participants after the final standings comes out. My rating hasn't changed neither, and recently it did take longer time to update the rating than before, probably due to the highly dense competitions this week. Wait for one or two hours and the rating will change, not a big deal.
The final standing is not out yet I think. Only open hacking phase is done. They will then run those main+extra test cases and then final standings will be out.
i think there is no system testing here
There is, see the announcements, due to blitz going on, they postponed it
Yeah I have just seen it
Ahh, I didn't notice that I thought that system testing has already finished, thank you for pointing out.
Thanks a lot guys for answering the query :D
Why did the contest become Unrated?
The system testing is delayed until 21:30 MSK due to the Blitz Cup. Hence, the rating will be updated later.
Hope this helps
How long does it typically take? Is there a way to check progress?
There will be a percentage of completion under the system testing. The time it takes depends on the amount of people, but usually it will take about 2 to 3 hours.
Dear MikeMirzayanov and AksLolCoding,
My disabled account is HuuBach, and the email associated with it is bach123456789101112131415@gmail.com.
I am writing regarding the recent ban on my account related to Codeforces Round 1084 (Div. 3)
I would like to acknowledge that I violated the contest rules. I fully understand that Codeforces enforces strict standards to ensure fairness for all participants, and my actions were inconsistent with those standards. I take full responsibility for my mistake.
I sincerely regret this behavior. Codeforces has been an important platform for my learning and development in competitive programming. If there is any possibility of reconsideration, I would be very grateful for a second chance. I am willing to accept any reasonable conditions, such as rating reset, removal of affected results, or probation.
I assure you that this will not happen again, and I will strictly follow all contest rules in the future.
Thank you for your time and consideration.
Best regards, HuuBach
G is awesome
yay i was able to do E
in t5, test two, right?