Code4Food's blog

By Code4Food, history, 6 years ago, In English

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

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

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

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 tried 4 1 1 2 1.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    No I modified the code to work on 1 1 2 1 on my pc. is the problem related to reading the input?

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yes, but I see that you already solved it.