結果
| 問題 |
No.999 てん vs. ほむ
|
| コンテスト | |
| ユーザー |
minr
|
| 提出日時 | 2020-03-31 17:13:20 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 241 bytes |
| コンパイル時間 | 126 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 32,760 KB |
| 最終ジャッジ日時 | 2024-06-24 20:57:36 |
| 合計ジャッジ時間 | 4,279 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 12 |
ソースコード
from collections import deque
N = int(input())
A = deque(list(map(int,input().split())))
s = 0
while len(A) > 0:
if (A[-1] - A[-2]) > (A[0] - A[1]):
s += A.pop() - A.pop()
else:
s += A.popleft() - A.popleft()
print(s)
minr