AtCoder Regular Contest 078

Submission #1422177

Source codeソースコード

N = int(input())
a = tuple(map(int, input().split()))
arai = sum(a)-a[0]
snuke = a[0]
ans = abs(snuke-arai)
for n in a[1:-1]:
    snuke += n
    arai -= n
    diff = abs(snuke - arai)
    ans = ans if ans < diff else diff
print(ans)

Submission

Task問題 C - Splitting Pile
User nameユーザ名 htkb
Created time投稿日時
Language言語 Python3 (3.4.3)
Status状態 AC
Score得点 300
Source lengthソースコード長 242 Byte
File nameファイル名
Exec time実行時間 152 ms
Memory usageメモリ使用量 24056 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - 00_example_01.txt,00_example_02.txt
All 300 / 300 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
00_example_01.txt AC 17 ms 2940 KB
00_example_02.txt AC 17 ms 2940 KB
01.txt AC 83 ms 14192 KB
02.txt AC 41 ms 6460 KB
03.txt AC 36 ms 5820 KB
04.txt AC 101 ms 16568 KB
05.txt AC 35 ms 5832 KB
06.txt AC 147 ms 24056 KB
07.txt AC 152 ms 23904 KB
08.txt AC 144 ms 24036 KB
09.txt AC 150 ms 23904 KB
10.txt AC 149 ms 23792 KB
11.txt AC 17 ms 3060 KB
12.txt AC 18 ms 3188 KB
13.txt AC 139 ms 21264 KB
14.txt AC 17 ms 3060 KB