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

Автор CP_Sucks, история, 4 года назад, По-английски

Can someone tell why i get MLE in Problem D of last round ?

https://codeforces.com/contest/1363/submission/82256919

Thanks in advance.

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

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

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

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

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

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

82259253 I simply added bunch of if(!~res) return 0; or if(s[0] == 'I') return 0;.

I think it's better not to ignore those If the subset of indices queried is invalid or you exceeded the number of queries (for example one of the indices is greater than n) then you will get x=−1. In this case, you should terminate the program immediately. or If the guessed password is incorrect, you will receive the string "Incorrect". In this case, you should terminate the program immediately. conditions. They're really there to help you debug.

If you find writing them everytime repetitive, you could just write a function which processes querying/answering like this.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    Hmm , but it still gives WA, ok i will modularise code and then debug thanks.