結果

問題 No.999 てん vs. ほむ
ユーザー 👑 KazunKazun
提出日時 2020-10-14 04:43:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 160 bytes
コンパイル時間 1,255 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 104,820 KB
最終ジャッジ日時 2023-09-28 00:28:45
合計ジャッジ時間 4,809 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,300 KB
testcase_01 AC 67 ms
71,272 KB
testcase_02 AC 62 ms
71,068 KB
testcase_03 AC 64 ms
71,508 KB
testcase_04 AC 60 ms
71,344 KB
testcase_05 AC 60 ms
71,228 KB
testcase_06 AC 64 ms
71,348 KB
testcase_07 AC 65 ms
71,300 KB
testcase_08 AC 68 ms
76,436 KB
testcase_09 AC 109 ms
100,268 KB
testcase_10 AC 76 ms
83,880 KB
testcase_11 AC 72 ms
81,136 KB
testcase_12 AC 94 ms
88,256 KB
testcase_13 AC 124 ms
101,744 KB
testcase_14 AC 117 ms
101,644 KB
testcase_15 AC 114 ms
101,736 KB
testcase_16 AC 115 ms
101,840 KB
testcase_17 AC 98 ms
104,812 KB
testcase_18 AC 98 ms
104,820 KB
testcase_19 AC 98 ms
104,680 KB
testcase_20 AC 102 ms
104,796 KB
testcase_21 AC 116 ms
101,432 KB
testcase_22 AC 116 ms
101,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())

A=list(map(int,input().split()))
M=sum(A[1::2])-sum(A[::2])
B=M

for i in range(N):
    M+=2*(A[2*i]-A[2*i+1])

    if B<M:
        B=M
print(B)
0