Mnmbrane's blog

By Mnmbrane, 9 years ago, In English

I'm getting a compilation error as my verdict on when submitting this code, but it runs fine on my computer. Any ideas?

http://codeforces.com/contest/489/submission/8759488

  • Vote: I like it
  • +3
  • Vote: I do not like it

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

You are using the to_string method to convert an integer to a string. This function only exists in C++11 and doesn't exist in previous versions. However, you are submitting in GNU C++, not C++ 11. A solution is to change the programming language you are submitting into GNU C++0x.

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

In Codeforces, you can submit your code in Custom Invocation to view the error information outputted by compiler when you got "strange" Compilation Error.

»
3 years ago, # |
  Vote: I like it +11 Vote: I do not like it

Check your header file sometimes our computer compiler run our code without including the header file(like we can use string related function without using string.h header file) but an online judge can't run a code properly without including the header file. So, check the header file :-).

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

    thanks for replying after 6 years :)

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

      Am still looking at comments though after 6 years haha