Codechef ide problem

In onlinegdb ide show correct answer
but in codechef ide


shows wrong ans.
Entire code is same but answer comes different in codechef ide.
i can’t paste code because code is ongoing contest problem’s solution
[link](

Is your solution code in Java? I am also facing this issue with Java solutions. Same logic works for other languages

My solution in c++ but it gives wrong ans.
but other ide give right answer

Try using same versions of c++ in Codechef and online one, and if it still holds then try to run in system IDE like visual studio or Sublime text. Most of the time whatever comes in System one is right.

1 Like

Which language are you using ?

c++