
Hello Codeforces!
I am very excited to offer you to participate in Codeforces Round 1005 (Div. 2), starting at Feb/16/2025 17:35 (Moscow time).
There will be 6 very epic tasks and you will have 2 hours to solve them. All problems were authored and prepared by me. This round will be rated for all participants with rating below 2100.
I would like to thank the following list of orzosities for making this round possible:
- flamestorm for coordinating and helping with problem preparation.
- My army of testers: N_z__, triple__a, sammyuri, _istil, Dominater069, nifeshe, awesomeguy856, Error_Yuan, anango, temporary1, efishel, turska, Wxssim, amoeba4, Wizard_of_Orz, Proof_by_QED, myst-6, Friedrich, weirdflexbutok, That_Salamander, rewhile, Hori, vikram108, lowbob, doujinshi_master, redpanda, RobinFromTheHood, larush, Jasonwei08, beaten_by_ai, alwyn, chromate00, lucaski2, theweakestsilver.
- cry for not testing.
- MikeMirzayanov for codeforces and polygon.
- Alexdat2000 for translating the statements into russian.
- You for participating.
Good luck, have fun and I hope you have non-negative rating changes!
Score distribution: $$$500 - 1000 - 1250 - 1750 - 2250 - 2750$$$
UPD: editorial
UPD2: Congratulations to the winners!
From Div2:
From Div1 and Div2:









As a tester, I found the problems really cool! I encourage you to participate and have fun.
As a tester, you can't spell Intellegent without int
As a tester, you can't spell Intellegent without leg
you can't without tell
can't spell Intellegent without e
can't spell Intellegent without eg
can't spell Intellegent without ege
can't spell Intellegent without egen
can't spell Intellegent without egent
can't spell Intellegent without el
can't spell Intellegent without ell
can't spell Intellegent without elle
can't spell Intellegent without elleg
can't spell Intellegent without ellege
can't spell Intellegent without ellegen
can't spell Intellegent without ellegent
can't spell Intellegent without en
can't spell Intellegent without ent
can't spell Intellegent without g
can't spell Intellegent without ge
can't spell Intellegent without gen
can't spell Intellegent without gent
can't spell Intellegent without i
can't spell Intellegent without in
can't spell Intellegent without int
can't spell Intellegent without inte
can't spell Intellegent without intel
can't spell Intellegent without intell
can't spell Intellegent without intelle
can't spell Intellegent without intelleg
can't spell Intellegent without intellege
can't spell Intellegent without intellegen
can't spell Intellegent without intellegent
can't spell Intellegent without l
can't spell Intellegent without le
can't spell Intellegent without leg
can't spell Intellegent without lege
can't spell Intellegent without legen
can't spell Intellegent without legent
can't spell Intellegent without ll
can't spell Intellegent without lle
can't spell Intellegent without lleg
can't spell Intellegent without llege
can't spell Intellegent without llegen
can't spell Intellegent without llegent
can't spell Intellegent without n
can't spell Intellegent without nt
can't spell Intellegent without nte
can't spell Intellegent without ntel
can't spell Intellegent without ntell
can't spell Intellegent without ntelle
can't spell Intellegent without ntelleg
can't spell Intellegent without ntellege
can't spell Intellegent without ntellegen
can't spell Intellegent without ntellegent
can't spell Intellegent without t
can't spell Intellegent without te
can't spell Intellegent without tel
can't spell Intellegent without tell
can't spell Intellegent without telle
can't spell Intellegent without telleg
can't spell Intellegent without tellege
can't spell Intellegent without tellegen
can't spell Intellegent without tellegent
As a tester, holy guacamole
Bro took it personally :)
Bro you built a brute force code to write this!
Yeah, I used set of strings and iterated over all substrings
OMG! you are Intellegent
My delta in this contest confirms that
Should I call you -106 Intellegent?
;-;
As a tester, I can’t spell
As a tester, you can't spell Intellegent without gent
As a non-tester, I will probably find the problems really cool! I encourage you to participate and have fun.
I doubt that Intellegent has eaten the same kind of crayons as the crayon ate by cry
As a tester of this Intellegent round, the intelligence of this tester was tested.
it should be intellegence
As a Live Tester, I hope problems are really cool.
Intelligent round yay
as a participant i wish to cyan :)
As a participant I hope to find the problems to be mind-blowing!
hi from discord
hi
As a tester, I was not Intellegent while doing my VC.
As a tester, this is my second "as a tester" comment.
As a tester, I can confirm that Intellegent is very good at being intellegent
As a tester, the problemset had Intellegent and very cool problems.
As a tester, Intellegent forgot to mention me :sobb:
upd: he fixed it :)
Haiya, at least it means you are free to join and win some points :)
Is it you K?
It's not you, it's me...
Dream team, they are on a good side
As a tester, hello.
Orz
As a nobody, this should be an interesting contest
mandatory Wxssim gupta_samarth orz
tarek orz
As Wxssim's GF, I am forced to orz.
orz maxing
mandatory Wxssim orz
as a tester, i turned british after testing the round
As a tester, Intellegent orz
As a non intellegent, Intellegent is orzosity
As a tester, where is AMDlegent
As a tester,
as a participant this cat looks like Intellegent
can confirm
May be there is Codeforces in Codeforces in this round sammyuri
I am sick and tired of all these copy-pasted "As a tester/participant" comments. Give me those downvotes.
Wow great testers
flamestorm round :)
finally an Intellegent round, LETS GOOOOO!!!!!
why is this blog not on the HOME page?
I hope this contest will stop my downfall
As a participant,I am not a tester
As a participant! I wish cheaters will not come to participate
I like the cat in the announcement
16th will be an interesting day
omg Intellegent round!! :catshock:
Bring Reporting Option in Codeforces MikeMirzayanov , so that the community can help cleaning away cheaters.
As a (possible) participant, I hope to reach cyan this round.
positive delta plz
it tooks me days to realize the round author is "Intellegent" instead of "Intelligent"...
As a tester, I am late to comment.
Intellegent orz
Wish I can reach Master after this contest!
I mentally screamed through the entire blog after seeing the cat picture—it instantly took over my mind!
I’ve come too far to stop now! No matter how tough it gets, I’ll reach Expert this time.
Pray for me to become grand master and for Palestine to be free!
As a tester, I miss my pupil tester friends.
Hope to reach 1700!
Intellegent round; is this my return to CP?
As a participant whose laptop suddenly died today, I will attempt this contest in Termux
As someone who started learning programming this month why are the easiest problemsets so hard
hopefully Δ ≥ 0
As a contestant, too hard problemset
Agree
ARE THE RECENT ROUNDS TOO HARD FOR REAL OR MY ALREADY DUMB MIND GETTING DUMBER ????
The easier problems are getting hard to be honest. for me D was much easier than B and C.
I found C way harder than D.
problem D is dp on bits right? exactly where I'm bad at :(
my solution was not dp. try to think about it this way. the candidates than you might lose to if you go from right to left is not that much (at most 30) because your most significant bit will reduce once you beat a tough opponent. (wont get into details but think about it this way who is the first person that has a chance at beating you. if you beat them what will happen to you)
I do have the same observation, I know the step wont be over 30, but each step can be very long (leads to TLE at 1st submission). I'm stuck at optimize prepare the step down index array.
you need to find an appropriate DS to handle that. What I did was making an array of vectors with length 30 and for each element in the array I did this :
v[mostsignificantbit[a[i]].push_back(i)
Now for the querry q if you assume b to be the mostsignificant bit of q you can iterate on b,b+1,..,30 and find the closest tough enemy to you
yep, same idea. Too bad when I realize what to do I panic as the contest time only about 20 minutes left...
definitely skill issue.
goodbye blue
breh that's precisely my experience as well when I got to blue -- nice performance to get there, and then DOWNHILL. dw, it'll come back up lol
Ratings are very fickle i've found. Especially in rounds where many people solved ABC and it comes down to speed and lack of bugs. Your rating change can vary from -150 to +150 with the exact same problems solved.
same for specialist
Problem $$$D$$$ was amazing
Thank you for this nice contest ^_^
Loved the problems though they were slightly difficult than usual , why is Time limit set to 5s in D?
btw weakest pretest1 I've ever seen. it's literally designed to get WA2 for guesser.
I hope plag check will be strong cause D was leaked on yt ban anyone who has similar code — >
Not sure about D but man if there was plag check in C i guess a lot of people will be false flagged
in my room almost everyone had the same logic and implementation.
C has very small code I agree we cant flag C solutions because question was like a+b? everyone would have same answer
Awesome problems!! Thanks
C pretest 2 D:
C felt way easier than usual felt like I was solving 1000 rated problem
C ruined my contest I spent 1 hour unfortunately :(
maybe its just me , I started thinking in direction of what if there were only positive/ negative values how one should maximize then etc etc
how come divide and conquer on dp easy to you?
bro what overkilling did u do , it was simple prefix/suffix calculation
by the way, do you have any idea for F?
bro I closed my PC after reading D
C was really annoying for me
A was difficult than C for me
can anyone tell why my code is giving tle
submission link : https://mirror.codeforces.com/contest/2064/submission/306429358
my idea : if msb of x is more than some subset than it will be to eat them and merge into them so binary searching on this how much i can eat
then let say some element came then either it will kill me or it will be merged
so if bs tells no more merging possible
then i will check it by if else coindition
what more optimisations can be done
Hard A, B, C
7k solves on A, B, C
Pick one.
I was also surprised on the number of solves on C. I mean, the ultimate solution was simple enough, but idk...
~~~~~~~~~~ ll n; cin >> n; vector v(n); for(int i=0;i<n;i++) { cin >> v[i]; } ll maxi=abs(v[0]); ll curmax=0; if(n==1) { cout << abs(v[0]) << endl; return; } for(int i=0;i<n-1;i++) {
if( v[i+1]>0 && v[i]<0) { curmax=curmax+abs(v[i]); maxi=max(curmax,maxi); curmax=0; if(i==n-2) { maxi=max(maxi,abs(v[n-1])); } } else { curmax=curmax+abs(v[i]); if(i==n-2) { curmax=curmax+abs(v[n-1]); } maxi=max(curmax,maxi); } }~~~~~~~~~~~ why is my code failing for div2 C i tested soo many test cases cout << maxi << endl;
This is a standard prefix suffix sum problem. Try to think in that direction. Hopefully you will get it.
my code does prefix sum only
bro your code is some random greedy logic which is completely wrong
here is one test case
9 -6 -5 2
your code output is 11
but the correct answer is 20
first remove -5
then -6 then 9
it can be solved by dp also you can see my code
try to find error in your logic as well
my code is outputing 20 in vscode
my bad i passed array without size
try this
9 -6 2 -5
answer is 20 for this
but yours is giving 15
Is my solution supposed to get a TLE or I missed something?... have already tried my best to it..
My TLE solution for Problem D
For my solution, D was timing out until I cached helper functions between queries
interesting<3
And their brilliant idea is now ruined because some idiot pointed it out publicly! Well done!
Nice, I want to see how people solved D in the contest by checking 4 random people and finding 3 identical code. Totally not sus. Btw here are the codes that I checked Code 1 Code 2 Code 3 Code 4
Screencast with commentary
Does anyone else think there was a lot of cheating today?
Of course there was. But I think there is no way to prevent cheating at this point so the best thing you can do is ignore them and do your best.
Hello, I'm really shocked that I got TLE for my B submission, because it has only 3 for loops which takes O(n) for each, so I think there isn't any reason that I will make infinite loop or something else to TLE, can anyone help me? https://mirror.codeforces.com/contest/2064/submission/306374719
I think, it's "Mem"
Well, I don't think so, since I've used that technique for numerous times and check if some element is in dict/make new element in dict in Python is O(1), so the loop that constructs mem only takes O(n) time. Can you explain more why did you think that point makes TLE?
Since, I didn't find any other options. I sometimes saw, Python dictionaries give a TLE; that's why.
Same here, I'm a bit surprised too. I suspect it's because of repeatable inputs in Python. But usually 10^4 inputs work. It's really strange I think that even 10^5 inputs have worked once for me. Almost a half of participants around me got B rejected.
I just found the test cases, and test case 8 is just the case that has one line, which has n=200000, but I'm still feel confused because test case 7 is also in same manner and it took only <200ms...
using dict or Counter in python is a sin... I got FST a few times for the same situation (people blow up hashmap/dict somehow).
If you choose to use map, use random Wrapper around it (value ^ random). To be safe from those hacks.
wait, but in that case, suppose that it's kinda hash map collision, then is it possible to make TLE?
so sad but True, TLE is possible.
source here
Wow, I'm really surprised for that, and as changing to not using dict, I easily got accepted, OMG Thanks a lot!
No prob, I was hurt too by this hacks in Hello 2025. FST and bam bye bye rating. (in my case it was collections.Counter, which is dict based too)
Cool Problem D
Too many cheating in today's contest.
Yes, look at all of these people who have the same obvious gpt solutions to problem D. I estimate at least 10% of the people in the top 500 cheated in some way. If someone would make a blog compiling these that would be much appreciated (I have not done any contests, so cannot blog). I'm sure there are more submissions like these, but the slow codeforces servers make it way too tedious to check thoroughly.
https://mirror.codeforces.com/profile/CodySummers https://mirror.codeforces.com/profile/Ban_Mindeveloped_Please https://mirror.codeforces.com/profile/SAAE3 https://mirror.codeforces.com/profile/Moiz_khan https://mirror.codeforces.com/profile/akkumar.cse https://mirror.codeforces.com/profile/Md_Nomaan_khan https://mirror.codeforces.com/profile/Dominatrixx https://mirror.codeforces.com/profile/mohitprajapati2444 https://mirror.codeforces.com/profile/kaushalaknurwar96 https://mirror.codeforces.com/profile/MahendraSinghThakur https://mirror.codeforces.com/profile/ish1331 https://mirror.codeforces.com/profile/Shubham__kumar https://mirror.codeforces.com/profile/isogeny https://mirror.codeforces.com/profile/Zlin05 https://mirror.codeforces.com/profile/mahmmoad_aziza https://mirror.codeforces.com/profile/ankit_iiitg https://mirror.codeforces.com/profile/lalithcodes09 https://mirror.codeforces.com/profile/subhrank https://mirror.codeforces.com/profile/Shubhra007 https://mirror.codeforces.com/profile/AJINKYA_LAKHARA https://mirror.codeforces.com/profile/Mysterio_15 https://mirror.codeforces.com/profile/quangdepzai https://mirror.codeforces.com/profile/arpitmalik https://mirror.codeforces.com/profile/Durgesh_7979 https://mirror.codeforces.com/profile/Vodangngoclam2013 https://mirror.codeforces.com/profile/nishant_10002 https://mirror.codeforces.com/profile/1chandanAAA https://mirror.codeforces.com/profile/AlissaCallender https://mirror.codeforces.com/profile/acoderforfun https://mirror.codeforces.com/profile/bdyby1009 https://mirror.codeforces.com/profile/Accclone001 https://mirror.codeforces.com/profile/NealMead
https://mirror.codeforces.com/contest/2064/submission/306390015
https://mirror.codeforces.com/contest/2064/submission/306390440
How these two submission is same to same..Even comments
It is so unfortunate. I used to be a Master a long time ago and now even though I know I am better than before I cannot pass expert rank due to cheaters. Problems have gotten more tricky and ad-hoc which is not my style and people copy paste those solutions from chatgpt and get away with it. I just want to participate in a Div.1 contest again :(
how much is the penalty for getting a wrong answer in todays contest
please dont downvote me , im new and arab
The penalty is 50 points per incorrect submission. As I understand, this is approximately the same as: - 25 minutes penalty for problem A - 12,5 minutes penalty for problem B - 8,3 minutes penalty for problem C
Please, correct me if I'm wrong.
Intellegent You are an artist for creating problem D. I could not solve it in contest but that's my bad. The problem is very good.
How my solution got TLE on problem B? I think it is a linear time complexity right?
any ideas? thanks!
collections.Counter are dict-based in python, so it's vulnerable to hash collision. For further details what's the cause and prevention method, I'll refer to this source
wish you never do rounds again