Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

CODESofRishi's blog

By CODESofRishi, history, 4 years ago, In English

I have an issue! Can anyone pls help in resolving it.

I tried submitting code for the problem: Uncowed Forces

My Solution: My Code

Even though my code is giving correct output on my machine for the test case:

55 66 75 44 47
6 0 6 6 10
19 0

CORRECT OUTPUT: 6414

But on submitting Codeforces is generating output 6413, hence giving the verdict as Wrong Answer!

Why is this the case?

Is there something wrong with my implementation?

Or is there any issue from Codeforces side?

  • Vote: I like it
  • 0
  • Vote: I do not like it

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

You are using double. Try submitting with gnu c++17 (64 bit msys 2) It will process the mode accurate result and your code will get accepted.

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

    Yes it worked! But, can you please elaborate more about it!?

    What you are saying is, can one not use double in the usual C++17 option?

    Also can you pls specify the difference in C++17 && C++17(64bit) options on Codeforces?

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

      double is a floating-point type, which is inaccurate in its nature.

      Don't use it when it's not necessary.