gilcu3's blog

By gilcu3, 9 years ago, In English

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
 
 
 
 
  • Vote: I like it
  • -12
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

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

      • »
        »
        »
        »
        9 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

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

»
9 years ago, # |
Rev. 3   Vote: I like it +9 Vote: I do not like it

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