krishna_7's blog

By krishna_7, history, 3 months ago, In English,

I am getting a compilation error while submitting horrible queries on SPOJ. When I run the code locally, there is no issue and I am getting correct output for the cases I've tried. Someone please take a look at my code and tell me why I am getting a compilation error. Here is my code,

 
 
 
 

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

In ideone there is runtime error not compilation error as you claim. Runtime error may be because you left stdin blank and your program read junk values. Its running fine on ideone, https://ideone.com/gjnhea

  • »
    »
    3 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I get a compilation error when I submit it on SPOJ. Its running fine locally and on ideone.

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

You're getting error because the queries are horrible. The program knows it will receive a set of horrible queries, so it won't compile. It's self-defense.

  • »
    »
    3 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Well this did make me laugh. But it would be helpful if you could solve my issue too. :p

    • »
      »
      »
      3 months ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      If your code compiles OK locally, are you sure you're selecting the correct compiler when submitting?

      • »
        »
        »
        »
        3 months ago, # ^ |
        Rev. 2   Vote: I like it +3 Vote: I do not like it

        Well thank you, I wasted 2 hours only to realise, it compiles fine on C++6.3 and not on C++ 4.3.2. It got accepted now. :)