結果

問題 No.2210 equence Squence Seuence
ユーザー Shirotsume
提出日時 2023-02-11 00:06:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 411 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 107,304 KB
最終ジャッジ日時 2024-07-07 17:48:14
合計ジャッジ時間 3,743 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

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()

q = deque([n - 1])

for i in range(n - 2, -1, -1):
    if a[i] <= a[i+1]:
        q.append(i)
    else:
        q.appendleft(i)
print(*(a[:q[k-1]] + a[q[k-1]+1:]))
    
0