結果

問題 No.999 てん vs. ほむ
ユーザー NoneNone
提出日時 2021-05-05 02:49:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 2,017 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 112,672 KB
最終ジャッジ日時 2023-10-01 04:48:24
合計ジャッジ時間 4,157 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,400 KB
testcase_01 AC 70 ms
71,060 KB
testcase_02 AC 71 ms
71,188 KB
testcase_03 AC 71 ms
71,496 KB
testcase_04 AC 73 ms
71,252 KB
testcase_05 AC 71 ms
71,132 KB
testcase_06 AC 71 ms
71,252 KB
testcase_07 AC 70 ms
71,144 KB
testcase_08 AC 81 ms
76,504 KB
testcase_09 AC 132 ms
108,268 KB
testcase_10 AC 88 ms
85,452 KB
testcase_11 AC 85 ms
81,372 KB
testcase_12 AC 95 ms
91,136 KB
testcase_13 AC 137 ms
112,596 KB
testcase_14 AC 135 ms
112,608 KB
testcase_15 AC 138 ms
112,488 KB
testcase_16 AC 135 ms
112,672 KB
testcase_17 AC 114 ms
103,360 KB
testcase_18 AC 115 ms
103,228 KB
testcase_19 AC 113 ms
103,508 KB
testcase_20 AC 121 ms
103,312 KB
testcase_21 AC 132 ms
112,392 KB
testcase_22 AC 134 ms
111,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int, input().split()))
B=[0]
C=[0]
for i in range(N):
    B.append(A[2*i]-A[2*i+1]+B[-1])
    C.append(A[2*N-1-2*i]-A[2*N-1-(2*i+1)]+C[-1])
C.reverse()
res=0
for i in range(N+1):
    res=max(B[i]+C[i],res)
print(res)
0