Submission #1959721


Source Code Expand

N = int(input())
A = list(map(int, input().split()))
total = 0
ans = 0
for a in A:
  t = total + a
  if t != 0 and total * t <= 0:
    total = t
    continue
  ans += abs(t)+1
  total = -1 if total > 0 else 1

print(ans)

Submission Info

Submission Time
Task C - Sequence
User espressivosubito
Language Python (3.4.3)
Score 0
Code Size 232 Byte
Status WA
Exec Time 83 ms
Memory 14332 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 9
WA × 9
Set Name Test Cases
Sample 00-00.txt, 00-01.txt, 00-02.txt
All 00-00.txt, 00-01.txt, 00-02.txt, 01-00.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt
Case Name Status Exec Time Memory
00-00.txt AC 17 ms 2940 KB
00-01.txt AC 17 ms 3060 KB
00-02.txt AC 17 ms 2940 KB
01-00.txt WA 79 ms 14332 KB
01-01.txt AC 83 ms 14212 KB
01-02.txt WA 81 ms 13784 KB
01-03.txt WA 75 ms 13280 KB
01-04.txt AC 73 ms 12764 KB
01-05.txt WA 68 ms 11884 KB
01-06.txt WA 76 ms 13676 KB
01-07.txt AC 71 ms 12552 KB
01-08.txt AC 80 ms 14332 KB
01-09.txt WA 73 ms 12760 KB
01-10.txt WA 63 ms 11068 KB
01-11.txt AC 77 ms 13788 KB
01-12.txt WA 79 ms 14332 KB
01-13.txt WA 73 ms 13136 KB
01-14.txt AC 83 ms 14212 KB