I recently participated on Codeforces Round 402 (Div. 1) and my code to problem A passed pretests with this.
http://codeforces.net/contest/778/submission/25032443
On line 31 there is this
"mid=(left+right)+1/2;"
My whole binary search is wrong but it still passed pretests
Should the pretest be set such that at least codes with this kind of mistakes shouldn't pass the pretests?
Auto comment: topic has been updated by gamegame (previous revision, new revision, compare).
The solution is not wrong, it is slow: the right bound is actually decreased by 1 in every iteration.
There are no hard rules about what goes into pretests and what doesn't. They are the result of a reasonable trade-off between checking for the most stupid errors and keeping the system tests and hacks eventful. Additionally, problem setters probably won't think of every possible stupid error since there are just too much, and their categorization of errors into pretest errors and main test errors may also vary with yours. So, I'd not rely on pretests too much.
Man don't get sad
here I sent a code for completely another problem and it passed the pretests
If it helps , I had atleast 2 solutions which passed pretests and failed main tests in last 4 contests :'(
Sometimes pretests are too weak and its okay.
See This
Pretests had no case where answer was 0.