結果

問題 No.999 てん vs. ほむ
ユーザー ああいいああいい
提出日時 2021-12-05 18:03:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,564 KB
実行使用メモリ 30,156 KB
最終ジャッジ日時 2023-09-21 14:37:55
合計ジャッジ時間 4,640 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,752 KB
testcase_01 AC 15 ms
7,852 KB
testcase_02 AC 16 ms
7,732 KB
testcase_03 AC 17 ms
7,812 KB
testcase_04 AC 16 ms
7,780 KB
testcase_05 AC 15 ms
7,864 KB
testcase_06 AC 15 ms
7,756 KB
testcase_07 AC 16 ms
7,872 KB
testcase_08 AC 20 ms
8,932 KB
testcase_09 AC 143 ms
28,432 KB
testcase_10 AC 54 ms
14,060 KB
testcase_11 AC 41 ms
11,944 KB
testcase_12 AC 72 ms
17,200 KB
testcase_13 AC 157 ms
29,816 KB
testcase_14 AC 158 ms
29,884 KB
testcase_15 AC 156 ms
29,856 KB
testcase_16 AC 158 ms
29,868 KB
testcase_17 AC 136 ms
29,440 KB
testcase_18 AC 135 ms
29,052 KB
testcase_19 AC 137 ms
30,156 KB
testcase_20 AC 139 ms
29,384 KB
testcase_21 AC 139 ms
29,804 KB
testcase_22 AC 137 ms
29,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
_max = 0
for i in range(N):
    _max += -A[i * 2] + A[i * 2 + 1]
now = _max
for i in range(0,N):
    now += 2 * A[i * 2] - 2 * A[i * 2 + 1]
    if now > _max:
        _max = now
print(_max)
0