結果

問題 No.2210 equence Squence Seuence
ユーザー ニックネームニックネーム
提出日時 2023-02-10 21:46:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 245 ms / 2,000 ms
コード長 298 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 30,708 KB
最終ジャッジ日時 2023-09-21 22:54:09
合計ジャッジ時間 4,935 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,296 KB
testcase_01 AC 19 ms
8,452 KB
testcase_02 AC 19 ms
8,492 KB
testcase_03 AC 63 ms
13,272 KB
testcase_04 AC 67 ms
13,980 KB
testcase_05 AC 95 ms
16,932 KB
testcase_06 AC 86 ms
15,932 KB
testcase_07 AC 189 ms
28,124 KB
testcase_08 AC 19 ms
8,456 KB
testcase_09 AC 18 ms
8,540 KB
testcase_10 AC 18 ms
8,488 KB
testcase_11 AC 18 ms
8,560 KB
testcase_12 AC 18 ms
8,372 KB
testcase_13 AC 229 ms
30,156 KB
testcase_14 AC 228 ms
30,300 KB
testcase_15 AC 227 ms
30,232 KB
testcase_16 AC 230 ms
30,228 KB
testcase_17 AC 226 ms
30,272 KB
testcase_18 AC 18 ms
8,456 KB
testcase_19 AC 19 ms
8,392 KB
testcase_20 AC 18 ms
8,392 KB
testcase_21 AC 18 ms
8,580 KB
testcase_22 AC 19 ms
8,380 KB
testcase_23 AC 209 ms
27,240 KB
testcase_24 AC 160 ms
22,344 KB
testcase_25 AC 184 ms
24,964 KB
testcase_26 AC 245 ms
30,708 KB
testcase_27 AC 80 ms
14,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n,k = map(int,input().split())
a = list(map(int,input().split()))
dq = deque([n-1])
for i in range(n-2,-1,-1):
    if a[i]>a[i+1]: dq.appendleft(i)
    elif a[i]<a[i+1]: dq.append(i)
    elif dq[0]==i+1: dq.appendleft(i)
    else: dq.append(i)
a.pop(dq[k-1])
print(*a)
0