結果

問題 No.999 てん vs. ほむ
ユーザー etale.K3etale.K3
提出日時 2021-05-03 13:42:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 165 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 30,028 KB
最終ジャッジ日時 2023-09-29 09:21:13
合計ジャッジ時間 3,805 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,828 KB
testcase_01 AC 15 ms
7,936 KB
testcase_02 AC 16 ms
7,816 KB
testcase_03 AC 15 ms
7,844 KB
testcase_04 AC 16 ms
7,872 KB
testcase_05 AC 16 ms
7,816 KB
testcase_06 AC 15 ms
7,788 KB
testcase_07 AC 15 ms
7,804 KB
testcase_08 AC 23 ms
8,680 KB
testcase_09 AC 109 ms
28,148 KB
testcase_10 AC 44 ms
14,004 KB
testcase_11 AC 34 ms
12,504 KB
testcase_12 AC 57 ms
17,088 KB
testcase_13 AC 119 ms
29,928 KB
testcase_14 AC 117 ms
29,796 KB
testcase_15 AC 117 ms
29,896 KB
testcase_16 AC 118 ms
30,028 KB
testcase_17 AC 107 ms
29,280 KB
testcase_18 AC 105 ms
29,120 KB
testcase_19 AC 106 ms
29,292 KB
testcase_20 AC 106 ms
29,380 KB
testcase_21 AC 110 ms
29,532 KB
testcase_22 AC 106 ms
29,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

B = [0] + [a-b for a,b in zip(A[::2], A[1::2])]

for i in range(N):
    B[i+1] += B[i]

print(max(B)*2 - B[-1])
0