Mnmbrane's blog

By Mnmbrane, 8 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?
»
8 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.

»
8 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.

»
2 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 :-).

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

    thanks for replying after 6 years :)

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

      Am still looking at comments though after 6 years haha

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

        When u are submitting try to see which programming language is set.

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

          The it liked MS C++, but I wanted to stick with GNU C++, so I refactored my code. I still got wrong answers afterward, but finally got an accepted answer at Submission #8759965 — Codeforces

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

            Did you get to solve the previous problem I ised -'0'and it is giving compiler error