結果
| 問題 | No.2210 equence Squence Seuence |
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2023-02-10 23:55:53 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 91 ms / 2,000 ms |
| コード長 | 372 bytes |
| 記録 | |
| コンパイル時間 | 263 ms |
| コンパイル使用メモリ | 85,572 KB |
| 実行使用メモリ | 122,112 KB |
| 最終ジャッジ日時 | 2026-03-29 08:46:39 |
| 合計ジャッジ時間 | 3,019 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
from collections import deque
n,k=map(int,input().split())
a=list(map(int,input().split()))
dq=deque()
dq.append(n-1)
top=True
for i in range(n-2,-1,-1):
if a[i]<a[i+1]:
dq.append(i)
top=False
elif a[i]>a[i+1]:
dq.appendleft(i)
top=True
else:
if top:
dq.appendleft(i)
else:
dq.append(i)
ng=dq[k-1]
ans=a[:ng]+a[ng+1:]
print(*ans)
とりゐ