I have been trying to submit my code for https://codeforces.com/contest/281/problem/B , and my code works prefectly fine on personal pc, hackerearth and codechef compilers, but fails on test 1 in codeforces. I used GNU C++14 on codeforces. Can anyone please explain what I am supposed to change to get it to work in codeforces compiler.
my codeforces submision:- https://codeforces.com/contest/281/submission/55179537
I think it's because of double: You should not compare it using
==
. In your code I guess you can just save the values or indices.