結果
| 問題 | No.999 てん vs. ほむ |
| コンテスト | |
| ユーザー |
Valkyrja
|
| 提出日時 | 2020-05-14 17:00:50 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 259 bytes |
| 記録 | |
| コンパイル時間 | 290 ms |
| コンパイル使用メモリ | 21,280 KB |
| 実行使用メモリ | 36,780 KB |
| 最終ジャッジ日時 | 2026-08-27 23:32:55 |
| 合計ジャッジ時間 | 5,807 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 12 |
ソースコード
n=int(input())
a=[int(j) for j in input().split()]
from collections import deque
q=deque(a)
ans=0
for i in range(n):
if q[0]-q[1]>q[-1]-q[-2]:
ans+=q.popleft()
ans-=q.popleft()
else:
ans+=q.pop()
ans-=q.pop()
print(ans)
Valkyrja