I am extremely delighted to invite you to participate in my first solo round, Codeforces Round 1050 (Div. 4), starting on 13.09.2025 17:35 (Московское время). There will be $$$7$$$ problems to be solved in $$$2$$$ hours and $$$15$$$ minutes.
The format of the event will be identical to Div. 3 rounds:
- ICPC rules with a penalty of 10 minutes for an incorrect submission;
- 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
- after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
- by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).
We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.
Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the fourth division, you must:
- take part in at least five rated rounds (and solve at least one problem in each of them),
- do not have a point of 1400 or higher in the rating.
Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), you may choose to participate rated or unrated.
PLEASE NOTE the rule restricting AI use. If you are caught using AI in an unorthodox manner, either by us manually or detected automatically, YOUR ACCOUNT WILL BE TERMINATED and your entire family will be sent to my basement (which has no toilets available). We will be actively scouring submissions and terminating rulebreakers.
I would like to thank the following individuals for making this contest possible:
Myself for coordinating the round
.Vladosiya for russian translations.
reirugan for improving the statements.
The following testuwuers: Proof_by_QED, reirugan, -firefly-, Filikec, Friedrich, mathtsai, __baozii__, Non-origination, chromate00, SpyrosAliv, Intellegent, Dominater069, Hori, RobinFromTheHood, pop, yse, Vladosiya, Lechaa, beaten_by_ai, macaquedev, catgirl, kingbass, tin.le2, ByteRaider, Trace_X1729, AksLolCoding, expertaq, kwant, santaclaus67, akane646, Hana05, .Habiba., apollo07, shuniko, Jteh, avighnakc, nifeshe, Edeeva, Eikyu, wuhudsm, and temporary1.
I know it has been a while without a division 4, so GLHF!








damn div 3 div2 div1 div 4 all happening in span of less than a week.good times
Div 1 was an illusion.
Contests are hosted so frequently this month, I feel like I’m on a treadmill of contests. At this point, Div.4 is just a training ground for speed typists, not programmers.
We should bring Nitro Typists here.
What's your wpm by the way(Just asking)
around 70 wpm
nice
as a tester, omg we actually have div4 testers wow
__baozii__ orz
A tester, or a testuwuer :)
testuwuer :)
As a tester, this is the first contest I’ve tested, and I recommend to participate as the problems are really high-quality.
how can i be a tester or problem setter in any official contest
Yeah, same question. Can anyone help? I am new on Codeforces.
so __baozii__ is forced to test div 4 too?
yes he is trapped in my attic with no windows. It’s where all of the testers are.
I don't think I want to be a tester anymore
I didn't see your name on the tester list.
Sooooooo are you a tester? If you aren't, how did you say "anymore"?
I wanted to be a tester.
I even asked how to be one in the past.
Don't want to be a tester anymore
As a tester
As a tester, I tested
As a tester, this is my first time that I tested all the problems.
Mandatory Shit comment:-
HI CHAT
Hana05 .Habiba. so proud of you my friends :3
As a tester, I'm feeling special for being the only grey tester in this round.
As a tester, you’re fake grey.
Not a gray anymore
Not enough action in the video, use Subway Surfers next time
As a tester, this is the most balanced div4 contest.
As a tester, you should participate in USACO ...
What if we aren't in USA? :D
You can still participate
How?
Just make an account and set ur country as something else
Ah, alright, thanks
As a testuwuer, I am extremely delighted to participate in cry's first solo round's testing.
delighted or forced? O-o
As a tester, my eyes get offended when I check the testers.
As a testuwuer, I am a person who tests codeforces contests.
insanely right
orz
as a div4 tester, this is a round.
As an unrated participant, I subbed to this YT channel
Miku mentioned
Another brainrot contest? :)
As a tester, I tested. Also, tin.le2 orz
OH I GET IT THE TESTERS' ORDER WAS RANDOM BECAUSE THEY WERE PACKED IN cry'S BASEMENT WITH NO WAY OUT. IT'S ALSO DARK THERE SO YOU CAN'T SEE THE COLORS.
omg it's all coming together
I just want to see my family again D:
hey look im a snail
orz
aHn my beloved
what the sigma
I am so excited to face my first ever Div.4 contest. While facing only 4 Div.3 contests, I heard about it. I really wonder why it is not taking place anymore. Finally I am so happy to see this coming. For new coders like me, it's really a very welcoming thing. I would like to invite my offline friends to this too. Highly appreciated.
We need a cry plushie!!!
Also, good luck to everyone, and orz to cry for creating a great(-probably :D-) contest.
So sad I can't participate live but I'll make sure to look at it right after.
Maybe even 100% who knows :)
This is cool.
I think this is the first Announcement that doesn't contain this line:
MikeMirzayanov and KAN for the great platforms.
If I don’t get a green tick in under 2 minutes on A, I’m retiring.
retire
lovely fufu saint fufu
As a contestant.. give me pupil to be rated in this round :(
probably the best kind of invite you can get these days
after 5 months of waiting:
This round will be destroyed by my superior skills
Good luck
Thank you !! same to you
Wish I could join but sadly I can't :(
Good luck
Its div 4 and my inner me!
I want to join the contest when I see MIKU, but I can't get rating ):
Please put F and G in the correct order next time
skill issue?
probably but F was def harder than G
Hello cry,
I recently participated in contest Codeforces Round 1050 (Div. 4), and my account HARI_PRASAD_2003 has been disabled. I would like to clarify my situation in hopes of avoiding any misunderstanding.
I have been an active Codeforces participant, with experience solving problems in Div-2 contests recently and consistently practicing to improve my skills. During this contest, I used my personal pre-built code snippets for input/output handling and basic templates. These are tools I developed myself to write code efficiently and do not give any unfair advantage in solving the problems.
The contest problems were within my skill level, and I solved them using my own knowledge and coding ability. I want to emphasize that I did not copy solutions from anyone else. I am concerned that my use of personal templates may have caused my activity to appear suspicious.
I sincerely apologize if my approach caused any misunderstanding. I fully respect Codeforces’ contest rules and the integrity of the platform, and I would greatly appreciate guidance on resolving this issue.
Thank you for your time and consideration.
— HARI_PRASAD_2003
Bro didn't mention he suspiciously named all the variables after Naruto characters lmfao. https://codeforces.me/contest/2148/submission/338413153 https://codeforces.me/contest/2148/submission/338423412
Thanks to the Coordinator, for the chance to get a quick back to Green..!
Div4 > Div3
problems were very very beautiful !
especially E, F
How did you solve F? I did an O(n*k), getting TLE
I did brute force sorting and picking the first one
i have solved 5 problems in my first time, clapsQwQ
F >>>>>>>> G
Nice round. My first time solving all problems in reverse order :)
F please someone, I might have had a breakdown had I made another wrong submission
Notice that there can be at most sqrt(k) different lengths of the strings.
Let's say we already chose a minimal prefix of the resulting string. Let's pick a continuation via bruteforce which will run in O(n + k) (just go through all strings and choose the smallest possible continuation).
There will be at most sqrt(k) iterations as when each iteration ends we get a prefix which is of greater length than before and has the same length as one of the strings in the input. Therefore there won't be any more than sqrt(k) iterations
My solution did something similar but it ended up not giving TLE can you tell me why: https://codeforces.me/contest/2148/submission/338467466
I think probably due to the use of multiset. It is pretty slow in general. And in the worst case I think it add a logarithm to the complexity, so your solution has a complexity of O(n * log(n) * sqrt(k)). Which is slow for the constraints of the problem. Especially given the fact that multi-set has a bad constant multiplier.
But it didn't give TLE
Ah, sorry, I'm bad at reading
here is my implementation of the idea: https://codeforces.me/contest/2148/submission/338531982
how did so many people solve E, i found it somewhat hard for div 4
For a given (l, r), the subarray (a[l, r]) is awesome if and only if the following condition holds:
where $$$\mathrm{freq}_{[l,r]}(x)$$$ denotes the number of occurrences of $$$x$$$ in the subarray $$$a[l,r]$$$, and $$$\mathrm{freq}_{[1,n]}(x)$$$ denotes the number of occurrences of $$$x$$$ in the entire array $$$a[1,n]$$$.
For each $$$r$$$, we maintain the leftmost $$$l$$$ such that $$$a[l,r]$$$ is awesome. Notice that as $$$r$$$ increases, $$$l$$$ is monotonic non-decreasing. Therefore, we can maintain $$$l$$$ using the two-pointer technique.
Hmm I maintained rightmost R instead of L,
maintaining leftmost L might have cleaner code
Hey guys any idea why my solution for F passed, even though it runs in O(k^2logn):
https://codeforces.me/contest/2148/submission/338467466
why is my code failing for problem F?
https://codeforces.me/contest/2148/submission/338499475
Start from Column 0 , find the smallest element in that column and add the rest of the row to the answer , then increment the column to ans.size() .
You are not checking the minimum element for a particular column .
but isn't this what I'm doing in both comparator functions? first I'm looking for the best starting row from the comp function, then after that row I'm sorting the rest based on the ending of that best row from the first sort, and I'm filling the ans vector with what's remaining from the current best row
because they didnt put the most common corner case into the preliminary tests
The problem G I did an O(n*sqrtn*logn) getting TLE.How to solve it?
precompute the factors
Beautiful contest, beautiful problems !!
The competition requires a good header image, and Miku gave me motivation.
G = "John's Last Wish" ... too dramatic for USACO
Can anyone tell me why my code is failing on F. https://codeforces.me/contest/2148/submission/338500676
Lexicographic order may change when first few characters are omitted. Try this.
Thanks for the round! I thought F was particularly fun as Div. 4 problems go. I wasn't as big a fan of B; it felt like the bulk of the difficulty came from (a) reading and understanding the problem and (b) making sure to read in the arrays even though they don't affect the answer, rather than outputting N and M and returning after each test case.
Literally i spent 15 minutes doubting my solution because of not using the elements lol
B is a fun thought provoking problem for div 4.
Can anyone hack my solution, don't know why it passed even though it is O(k^2logn) for F:
https://codeforces.me/contest/2148/submission/338467466
It is actually $$$O\left(\left(\sum k_i\right)^{3/2}\log n \right)$$$. The number of iterations of your while loop is $$$O(\sqrt{\sum k_i})$$$, because there are at most $$$O(\sqrt{\sum k_i})$$$ different length, and each iteration is $$$O\left(\left(\sum k_i\right)\log n \right)$$$.
Great contest. Wish codeforces would do something about the false alarm crawling issue. It really makes hacking rounds a lot less fun.
338476097
Host div 3 and div 4 contests on alternate weeks One week div 3, the next week div 4
how to report a cheater? :v
That was an amazing contest with truly inspiring problems!
It will be very helpful for newbie like us if you take div-4 contest more frequently .This helps us to know our place and boost our confidence.
i submitted same problem twice.they accepted my last submission.
In 5 minutes you solved 8 problem and again in 3 minute you solved 4 problem.! is it normal ?
Those don't look like in-contest submissions, so it doesn't really matter. More importantly, why are you posting someone's personal information? Delete this now (and don't edit it, since previous revisions are still avaliable.
Hello cry and contest coordinators, I would like to appeal regarding my submission (ID: 338500507) for problem 2148G. I solved the problem completely on my own during the contest and did not share my code with anyone. I understand that the checker found similarities with other submissions, but this problem had a fairly standard approach, and I also use a personal template which might make my code look similar to others like the code I used for BIT.
I did not knowingly upload my solution to any public place or share it with anyone. If there was any unintentional leakage, I sincerely apologize and will make sure this does not happen again.
I kindly request you to review my case. Thank you for your time and understanding.
Problem F reference: