結果

問題 No.2210 equence Squence Seuence
ユーザー ntudantuda
提出日時 2023-02-12 00:49:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 132,888 KB
最終ジャッジ日時 2023-09-22 19:42:54
合計ジャッジ時間 5,454 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,380 KB
testcase_01 AC 72 ms
71,216 KB
testcase_02 AC 71 ms
71,264 KB
testcase_03 AC 117 ms
85,548 KB
testcase_04 AC 103 ms
87,116 KB
testcase_05 AC 111 ms
88,524 KB
testcase_06 AC 109 ms
86,152 KB
testcase_07 AC 151 ms
100,656 KB
testcase_08 AC 72 ms
71,180 KB
testcase_09 AC 71 ms
71,520 KB
testcase_10 AC 73 ms
71,236 KB
testcase_11 AC 73 ms
71,516 KB
testcase_12 AC 72 ms
71,520 KB
testcase_13 AC 164 ms
107,664 KB
testcase_14 AC 165 ms
107,576 KB
testcase_15 AC 166 ms
107,800 KB
testcase_16 AC 168 ms
107,624 KB
testcase_17 AC 169 ms
107,628 KB
testcase_18 AC 72 ms
71,172 KB
testcase_19 AC 72 ms
71,332 KB
testcase_20 AC 72 ms
71,484 KB
testcase_21 AC 72 ms
71,296 KB
testcase_22 AC 73 ms
71,172 KB
testcase_23 AC 145 ms
121,284 KB
testcase_24 AC 130 ms
111,652 KB
testcase_25 AC 139 ms
116,432 KB
testcase_26 AC 157 ms
132,888 KB
testcase_27 AC 106 ms
90,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
A.append(10 ** 6)
B1 = []
B2 = []
tmp = []
for i in range(N):
    tmp.append(i)
    if A[i] > A[i + 1]:
        B1 += tmp
        tmp = []
    elif A[i] < A[i + 1]:
        B2 += tmp
        tmp = []

B1 += list(reversed(B2))
x = B1[K - 1]

print(*(A[:x] + A[x + 1:-1]))
0