結果
問題 |
No.2210 equence Squence Seuence
|
ユーザー |
|
提出日時 | 2023-01-09 08:26:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 140 ms / 2,000 ms |
コード長 | 678 bytes |
コンパイル時間 | 269 ms |
コンパイル使用メモリ | 82,284 KB |
実行使用メモリ | 122,260 KB |
最終ジャッジ日時 | 2024-12-17 12:45:41 |
合計ジャッジ時間 | 5,571 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
import sys from collections import deque, Counter input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 63 - 1 mod = 998244353 n, k = mi() a = li() p = [-1] * n q = [] l = 0 r = n - 1 for i in range(n-1): q.append(i) if a[i] == a[i+1]: continue if a[i] < a[i+1]: while q: p[r] = q.pop() r -= 1 if a[i] > a[i+1]: while q: p[l] = q.pop() l += 1 q.append(n-1) while q: p[l] = q.pop() l += 1 ans = [] for i in range(n): if i == p[k-1]: continue ans.append(a[i]) print(*ans)