結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
52,256 KB
testcase_01 AC 42 ms
52,588 KB
testcase_02 AC 51 ms
52,756 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 96 ms
93,728 KB
testcase_07 AC 142 ms
123,752 KB
testcase_08 WA -
testcase_09 AC 44 ms
52,592 KB
testcase_10 AC 44 ms
53,232 KB
testcase_11 AC 43 ms
53,316 KB
testcase_12 AC 48 ms
52,704 KB
testcase_13 AC 167 ms
121,684 KB
testcase_14 AC 171 ms
121,284 KB
testcase_15 AC 172 ms
121,372 KB
testcase_16 AC 168 ms
121,720 KB
testcase_17 WA -
testcase_18 AC 48 ms
51,940 KB
testcase_19 AC 48 ms
52,868 KB
testcase_20 WA -
testcase_21 AC 43 ms
52,604 KB
testcase_22 WA -
testcase_23 AC 148 ms
127,540 KB
testcase_24 AC 132 ms
114,924 KB
testcase_25 AC 142 ms
120,940 KB
testcase_26 AC 166 ms
139,908 KB
testcase_27 AC 89 ms
90,416 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