結果

問題 No.999 てん vs. ほむ
ユーザー 💕💖💞💕💖💞
提出日時 2020-03-30 10:55:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 288 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 32,584 KB
最終ジャッジ日時 2023-09-02 09:27:07
合計ジャッジ時間 5,812 ms
ジャッジサーバーID
(参考情報)
judge13 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,284 KB
testcase_01 AC 15 ms
7,800 KB
testcase_02 AC 15 ms
7,808 KB
testcase_03 AC 15 ms
7,780 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 15 ms
7,828 KB
testcase_08 WA -
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

ax = list(map(int, input().split()))

mm = 0

while len(ax) != 0:
    left = ax[0] - ax[1]
    right = ax[-1] - ax[-2]

    if left > right:
        mm += left
        ax.pop(0)
        ax.pop(0)
    else:
        mm += right
        ax.pop()
        ax.pop()

print(mm)
0