結果

問題 No.999 てん vs. ほむ
ユーザー daidai_propro
提出日時 2020-02-28 21:45:44
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 232 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 37,880 KB
最終ジャッジ日時 2024-10-13 17:11:41
合計ジャッジ時間 4,159 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 2 WA * 4 TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
count = 0
for i in range(N):
    if max(A[0]-A[1],A[-1]-A[-2])==A[0]-A[1]:
        count += A[0]-A[1]
        A=A[2:]
    else:
        count+=A[-1]-A[-2]
        A=A[:-2]
print(count)
0