halo's blog

By halo, history, 9 years ago, In English

Here is my submission to the proble

115220090

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

»
9 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Your solution is just wrong.

  • You assign t = x + 1 for every increase operation, and do x = x - 1 for every decrease operation. This means, for example, that a program containing only increase operations will always output 1, regardless of the number of operations.
  • When you read N, the program doesn't read the newline character, so when you start reading the statements, the first line you read will be an empty one.

This is your solution with errors corrected: 11515073