結果

問題 No.2210 equence Squence Seuence
ユーザー ShirotsumeShirotsume
提出日時 2022-11-25 05:44:13
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 455 bytes
コンパイル時間 912 ms
コンパイル使用メモリ 82,472 KB
実行使用メモリ 140,116 KB
最終ジャッジ日時 2024-04-15 10:07:23
合計ジャッジ時間 5,743 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 40 ms
52,728 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 38 ms
52,800 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 125 ms
126,828 KB
testcase_24 AC 107 ms
114,688 KB
testcase_25 AC 118 ms
120,760 KB
testcase_26 AC 140 ms
140,116 KB
testcase_27 AC 78 ms
90,648 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[k - 1]
    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