結果

問題 No.2210 equence Squence Seuence
ユーザー ShirotsumeShirotsume
提出日時 2022-11-25 21:16:33
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 455 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 140,156 KB
最終ジャッジ日時 2024-04-15 10:07:28
合計ジャッジ時間 4,833 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,328 KB
testcase_01 AC 40 ms
53,788 KB
testcase_02 AC 40 ms
54,084 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 87 ms
93,532 KB
testcase_07 AC 132 ms
123,964 KB
testcase_08 WA -
testcase_09 AC 40 ms
53,744 KB
testcase_10 AC 39 ms
52,368 KB
testcase_11 AC 40 ms
52,412 KB
testcase_12 AC 40 ms
52,952 KB
testcase_13 AC 155 ms
121,748 KB
testcase_14 AC 150 ms
121,644 KB
testcase_15 AC 149 ms
121,924 KB
testcase_16 AC 149 ms
121,288 KB
testcase_17 WA -
testcase_18 AC 40 ms
53,428 KB
testcase_19 AC 40 ms
52,696 KB
testcase_20 WA -
testcase_21 AC 40 ms
53,164 KB
testcase_22 WA -
testcase_23 AC 130 ms
127,448 KB
testcase_24 AC 112 ms
114,732 KB
testcase_25 AC 126 ms
120,704 KB
testcase_26 AC 151 ms
140,156 KB
testcase_27 AC 80 ms
90,588 KB
権限があれば一括ダウンロードができます

ソースコード

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