Блог пользователя gamegame

Автор gamegame, 8 лет назад, По-английски

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?

  • Проголосовать: нравится
  • +29
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by gamegame (previous revision, new revision, compare).

»
8 лет назад, # |
  Проголосовать: нравится +98 Проголосовать: не нравится

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.

»
8 лет назад, # |
  Проголосовать: нравится +41 Проголосовать: не нравится

Man don't get sad

here I sent a code for completely another problem and it passed the pretests

  • »
    »
    8 лет назад, # ^ |
      Проголосовать: нравится -28 Проголосовать: не нравится

    If it helps , I had atleast 2 solutions which passed pretests and failed main tests in last 4 contests :'(

»
5 лет назад, # |
  Проголосовать: нравится -49 Проголосовать: не нравится

Sometimes pretests are too weak and its okay.

See This

Pretests had no case where answer was 0.