結果

問題 No.999 てん vs. ほむ
ユーザー prd_xxxprd_xxx
提出日時 2020-02-28 22:37:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 212 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 33,276 KB
最終ジャッジ日時 2024-04-21 19:46:07
合計ジャッジ時間 3,737 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,880 KB
testcase_01 AC 35 ms
10,752 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 29 ms
10,624 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 35 ms
11,520 KB
testcase_09 AC 194 ms
31,120 KB
testcase_10 AC 78 ms
16,688 KB
testcase_11 AC 61 ms
15,608 KB
testcase_12 AC 102 ms
20,204 KB
testcase_13 AC 212 ms
33,276 KB
testcase_14 AC 209 ms
33,148 KB
testcase_15 AC 211 ms
33,276 KB
testcase_16 AC 209 ms
33,272 KB
testcase_17 AC 186 ms
30,288 KB
testcase_18 AC 185 ms
29,112 KB
testcase_19 AC 183 ms
29,336 KB
testcase_20 AC 186 ms
29,480 KB
testcase_21 AC 179 ms
32,660 KB
testcase_22 AC 179 ms
31,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
B = [a-b for a,b in zip(A[::2], A[1::2])]
C = [0]
for b in B:
    C.append(C[-1] + b)
D = [0]
for b in reversed(B):
    D.append(D[-1] - b)
D.reverse()
ans = 0
for c,d in zip(C,D):
    ans = max(ans, c+d)
print(ans)
0