結果

問題 No.999 てん vs. ほむ
ユーザー SalmonizeSalmonize
提出日時 2020-03-02 20:35:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 189 ms / 2,000 ms
コード長 207 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,648 KB
最終ジャッジ日時 2024-04-21 22:49:51
合計ジャッジ時間 3,741 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 AC 30 ms
10,624 KB
testcase_02 AC 29 ms
10,880 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 30 ms
10,624 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 35 ms
11,648 KB
testcase_09 AC 171 ms
30,812 KB
testcase_10 AC 72 ms
16,528 KB
testcase_11 AC 59 ms
14,752 KB
testcase_12 AC 91 ms
19,548 KB
testcase_13 AC 187 ms
32,636 KB
testcase_14 AC 189 ms
32,648 KB
testcase_15 AC 189 ms
32,640 KB
testcase_16 AC 186 ms
32,508 KB
testcase_17 AC 167 ms
29,004 KB
testcase_18 AC 166 ms
28,808 KB
testcase_19 AC 169 ms
29,100 KB
testcase_20 AC 170 ms
29,132 KB
testcase_21 AC 181 ms
32,612 KB
testcase_22 AC 177 ms
31,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
l = list(map(int, input().split()))
a = [0] + l[::2]
b = l[1::2] + [0]
for i in range(n):
    a[i+1] += a[i]
    b[n-i-1] += b[n-i]
t = max(a[i]+b[i] for i in range(n+1))
print(t*2 - sum(l))
0