anayush_py's blog

By anayush_py, history, 10 months ago, In English

I want to know why my code gets different verdicts in different languages. When I upload my code using GNU C++20 (64), GNU C++17, or GNU C++17 (64) then I am getting "Wrong ans of test 1". But when I use Clang++17 Diagnostics or Clang++20 Diagnostics, the verdict is "Accepted". I used GNU C++20 (64) before and it used to be accepted but nowadays it doesn't. Please help!. Below is the submission link.

Code Submission

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

»
10 months ago, # |
  Vote: I like it +18 Vote: I do not like it

I haven't yet figured out the mistake but just a suggestion that please write neater codes. No need to use these kinds of templates at this level. Just simple codes... It will be helpful for you to figure out your mistakes that way.

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

    I too think there is no mistake in the code as I am getting desired output before submitting. Thanks for your advice.

»
10 months ago, # |
  Vote: I like it +8 Vote: I do not like it

You unsynchronized cin/cout with stdio then proceed to use scanf and cin. Maybe that is it, but I haven’t run locally.

see: https://stackoverflow.com/questions/31162367/significance-of-ios-basesync-with-stdiofalse-cin-tienull

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

    I tried it while just using cin and it worked perfectly in GNU C++20 (64). Thank you so much!