TestTrial's blog

By TestTrial, history, 5 weeks ago, In English

I'm trying to solve problem 18A (18A - Треугольник) at the moment, but for some reason i get RUNTIME ERROR on test 2 even though my code works perfectly fine both in VS Code and GDB online compiler. I have no idea what could be wrong and codeforces doesn't give me any hints. Any suggestions?

Here is my submission: 112722655

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

»
5 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

Mmmm not sure, but be carefully don't acces an invalid index in the array, sometimes our compilers have a strange behavior and cf is strictly, again not sure maybe the mistake is another thing

Good luck men!

»
5 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

You are accessing the index out of bound coo[i+3],coo[i-3] you can set condition for that if (i<3) coo[i+3]... if (i>2) coo[i-3]...