Submission #4033362
Source Code Expand
from operator import itemgetter import numpy as np N = int(input()) sum=0 count=0 s = input().split() for i in range(N): c = int(s[i]) if i==0: sum=c else: if np.sign(sum)*np.sign(sum+c)>=0: count += np.abs(sum+c)+1 sum = -1 * np.sign(sum) else: sum=sum+c print(count)
Submission Info
Submission Time | |
---|---|
Task | C - Sequence |
User | kakkey1964 |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 366 Byte |
Status | WA |
Exec Time | 1443 ms |
Memory | 20316 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
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 | 150 ms | 12388 KB |
00-01.txt | AC | 150 ms | 12388 KB |
00-02.txt | AC | 150 ms | 12388 KB |
01-00.txt | WA | 1273 ms | 20156 KB |
01-01.txt | WA | 1443 ms | 20316 KB |
01-02.txt | WA | 1204 ms | 19872 KB |
01-03.txt | WA | 1146 ms | 19472 KB |
01-04.txt | WA | 1298 ms | 19192 KB |
01-05.txt | WA | 1257 ms | 18536 KB |
01-06.txt | WA | 1263 ms | 19800 KB |
01-07.txt | AC | 1062 ms | 19072 KB |
01-08.txt | AC | 1190 ms | 20084 KB |
01-09.txt | WA | 1298 ms | 19172 KB |
01-10.txt | WA | 922 ms | 17924 KB |
01-11.txt | AC | 1170 ms | 19884 KB |
01-12.txt | WA | 1427 ms | 20088 KB |
01-13.txt | WA | 1120 ms | 19188 KB |
01-14.txt | AC | 1287 ms | 20088 KB |