結果
| 問題 | No.999 てん vs. ほむ |
| コンテスト | |
| ユーザー |
Valkyrja
|
| 提出日時 | 2020-05-14 17:00:50 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 259 bytes |
| 記録 | |
| コンパイル時間 | 579 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 36,208 KB |
| 最終ジャッジ日時 | 2026-04-04 19:28:31 |
| 合計ジャッジ時間 | 4,941 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