Ruden's blog

By Ruden, history, 5 years ago, In English

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

  • Vote: I like it
  • -3
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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.