結果

問題 No.2210 equence Squence Seuence
ユーザー Shirotsume
提出日時 2022-11-25 21:13:35
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 455 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 139,896 KB
最終ジャッジ日時 2024-10-05 03:51:36
合計ジャッジ時間 3,772 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(n, k, p):
    top = []
    bottom = []

    p.append(0)

    for i in range(n):
        if p[i] < p[i + 1]:
            top.append(i)
        else:
            bottom.append(i)
    q = top + bottom[::-1]
    ind = q[n - k]
    ans = []
    for i in range(n):
        if i == ind:
            continue
        ans.append(p[i])
    p.pop()
    return ans

n, k = map(int,input().split())

p = list(map(int,input().split()))

print(*solve(n, k, p))
0