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

Автор vamaddur, история, 7 лет назад, По-английски

http://codeforces.net/contest/145/submission/28183892

I keep missing Test Case #58 on this problem because my answer does not have enough elements. Does my program RTE before printing out the last 2 elements, or is my IO flawed in some way that prevents it from reading in the last few queries?

Please help, and thanks in advance! vamaddur

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

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

Why the downvote? I am asking a question for a PAST CONTEST not a CURRENT CONTEST. This is perfectly fine, so I see no reason to push the button.

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

    People tend to downvote post that ask question(they think is not meaningful) that's why. I can assure you that if you are asking a question for a current contest, your downvote would be 3 digits. Anyway, the problem is the size of your stuff is too small. Increasing it will give you TLE on test 80. Here you go. 28189330

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

    Further improving IO speed gives you AC. 28189632

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

Why does changing the size of "stuff" change the behavior of my code? The size is already 1000000, which is enough to hold any string that is given...

EDIT: Perhaps the newline character??? But why would this cause my code to miss two queries?

  • »
    »
    7 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    yes, it is the newline character, and that causes UB. So I don't know how it cause your code to miss 2 queries.

    EDIT: I don't mean the newline, but the \0 character. Sorry, wasn't paying attention when I reply.