Why the code output is different
Difference between en1 and en2, changed 123 character(s)
Recently, I was trying to solve the problem: [problem:1288A]↵
The submission: [submission:68862578]↵
The submission got accepted. If the compiler is changed to "GNU C++14" with the same code it gives the wrong answer in test 22; also, on test 50 it will give the same wrong answer it will output ("YES \n YES \n") I don't know which line that made the compilers give different output. Submission with "GNU C++14": [submission:68867586]↵
I tried to optimize the solution by this submission: [submission:68864007]↵
it gave the output ("YES \n YES \n") in test 50 No matter which compiler used. ↵
could anyone explain this behaviour?↵
**update:** I found the problem. the problem was in using float instead of double. So, float accuracy was less than double.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English THE_END 2020-01-15 17:47:30 123
en1 English THE_END 2020-01-15 17:14:48 668 Initial revision (published)