I'm new to codeforces I was practicing and I decided to solve this problem: Problem 899A I'm getting a runtime error although the algorithm runs smoothly on my pc here is a link to my submission: http://codeforces.com/contest/899/submission/33360057
I'm new to codeforces I was practicing and I decided to solve this problem: Problem 899A I'm getting a runtime error although the algorithm runs smoothly on my pc here is a link to my submission: http://codeforces.com/contest/899/submission/33360057
The problem specification says: "The first line contains single integer n... The second line contains a sequence of integers...".
Have you actually tried the input
4<ENTER>1 1 2 1
on your pc? I bet you just have tried4 1 1 2 1
.No I modified the code to work on 1 1 2 1 on my pc. is the problem related to reading the input?
Yes, but I see that you already solved it.