I used AI to fix my grammar, so this blog might look like it was written by AI.
So, recently, I participated in a school contest that had pretests. I was quite sure that I was going to get a high rank; however, after the system tests, I was disappointed to discover that I had forgotten to define int long long (and forgot many other stuffs), which ruined the whole thing.
So, how can I get better at handling pretests? I'm not talking about Codeforces rounds, because on Codeforces, the pretests are equal as the system tests.








I'm facing the exact same issue too.
Get better at problem solving!
You won't understand the feeling of ACing the pretest (which had exactly one test — the sample test), passing the stress test (without realizing that the brute-force code was wrong), and then getting 2/100 on the system tests (passing only 1 out of 50 test cases — the only one you passed was the pretest).
It is kinda funny ngl.
I mean basically, solve a lot of problems, I am not even close there!
Just get better in problem solving in general
might you not mind sharing the contest link
One thing that I have noticed in general is, when the idea you are thinking has a very bad implementation, that might not be the intended solution, because most questions have intended solutions based on 1 or 2 ideas. If you feel your way of thinking is clean enough, that is when you implement the solution
Learn to generate random tests and write code carefully and clearly (avoid overflow, MLE, RTE, corner cases). It’s less critical in online contests since you can resubmit, but in offline contests it’s essential if you’re starting CP. (I used AI to fix it because my English is bad)
That is not true, they are usually same as pretest on Div. 2+ for problems A to D, but in Div. 3/4/Edu, people can spam simple TLE or edge-case hacks to gain a lot of successful hacks with little risk. So you should also be careful of Codeforces' contests too.
Stress-test your code. Do not entirely trust pretests/samples
Lesson: never define but use type long long directly.