Submission #1689254


Source Code Expand

N = int(input())
A = list(map(int, input().split()))

x = A[0]
y = sum(A[1:])
ans = abs(x - y)
for i in range(1, N - 1):
    x += A[i]
    y -= A[i]
    ans = min(ans, abs(x - y))
print(ans)

Submission Info

Submission Time
Task C - Splitting Pile
User poyodr
Language Python (3.4.3)
Score 300
Code Size 202 Byte
Status AC
Exec Time 203 ms
Memory 24932 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 16
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
All 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 17 ms 2940 KB
00_example_02.txt AC 17 ms 2940 KB
01.txt AC 105 ms 14064 KB
02.txt AC 49 ms 6464 KB
03.txt AC 43 ms 5820 KB
04.txt AC 132 ms 16320 KB
05.txt AC 42 ms 5704 KB
06.txt AC 194 ms 23800 KB
07.txt AC 203 ms 24932 KB
08.txt AC 188 ms 23780 KB
09.txt AC 193 ms 23776 KB
10.txt AC 193 ms 23788 KB
11.txt AC 18 ms 3060 KB
12.txt AC 20 ms 3188 KB
13.txt AC 182 ms 21008 KB
14.txt AC 18 ms 3060 KB