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

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

Can somebody help me to find why this code gives WA: PON It's just a classical problem with a classical solution that should work fine...

Edit: Problem solved
  • Проголосовать: нравится
  • -12
  • Проголосовать: не нравится

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

It is better to use streams (cin) for reading, scanf implementations are not consistent across different OS, compilers, OJ ... is a mess.

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

    I have tried that, but it didn't work as well, so, can anybody spot another possible mistake?

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

      I have sent your code using cin (without using scanf) and got AC

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

        sorry, and yeah, I got AC too, I don't know what happened last time, but I was sure I sent it that way...

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

For scanf() and printf() you have to add cstdlib library. Try to send your code with cstdlib library.