結果

問題 No.2210 equence Squence Seuence
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-02-10 22:32:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 189 ms / 2,000 ms
コード長 390 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 121,508 KB
最終ジャッジ日時 2023-09-21 23:43:41
合計ジャッジ時間 6,150 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
71,852 KB
testcase_01 AC 95 ms
71,604 KB
testcase_02 AC 95 ms
71,944 KB
testcase_03 AC 128 ms
83,832 KB
testcase_04 AC 125 ms
85,204 KB
testcase_05 AC 140 ms
94,304 KB
testcase_06 AC 137 ms
91,032 KB
testcase_07 AC 176 ms
115,128 KB
testcase_08 AC 95 ms
71,752 KB
testcase_09 AC 93 ms
71,596 KB
testcase_10 AC 95 ms
71,716 KB
testcase_11 AC 95 ms
71,852 KB
testcase_12 AC 96 ms
71,600 KB
testcase_13 AC 186 ms
119,552 KB
testcase_14 AC 189 ms
121,468 KB
testcase_15 AC 187 ms
121,508 KB
testcase_16 AC 184 ms
119,764 KB
testcase_17 AC 185 ms
120,172 KB
testcase_18 AC 96 ms
71,744 KB
testcase_19 AC 94 ms
71,396 KB
testcase_20 AC 96 ms
71,600 KB
testcase_21 AC 96 ms
71,732 KB
testcase_22 AC 96 ms
71,400 KB
testcase_23 AC 164 ms
112,224 KB
testcase_24 AC 153 ms
104,472 KB
testcase_25 AC 159 ms
108,028 KB
testcase_26 AC 180 ms
120,808 KB
testcase_27 AC 123 ms
86,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n,k = map(int,input().split())
A = list(map(int,input().split()))
q = deque([])
pos = 0
last = n+1
for i in range(n)[::-1]:
    a = A[i]
    if a > last:
        pos = 0
    elif a < last:
        pos = 1

    if pos:
        q.append(i)
    else:
        q.appendleft(i)
    last = a

pos = q[k-1]
ans = A[:pos]+A[pos+1:]
print(*ans)



# 8 10 7 9 4 2 5 1 6 3
0