結果

問題 No.2210 equence Squence Seuence
ユーザー vwxyzvwxyz
提出日時 2023-09-11 06:30:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 349 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 32,444 KB
最終ジャッジ日時 2023-09-11 06:30:12
合計ジャッジ時間 7,983 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,776 KB
testcase_01 AC 17 ms
7,784 KB
testcase_02 AC 17 ms
7,808 KB
testcase_03 AC 81 ms
14,544 KB
testcase_04 AC 87 ms
14,836 KB
testcase_05 AC 126 ms
18,024 KB
testcase_06 AC 113 ms
16,384 KB
testcase_07 AC 258 ms
27,236 KB
testcase_08 AC 17 ms
7,816 KB
testcase_09 AC 16 ms
7,844 KB
testcase_10 AC 16 ms
7,904 KB
testcase_11 AC 16 ms
7,868 KB
testcase_12 AC 22 ms
7,748 KB
testcase_13 AC 318 ms
31,864 KB
testcase_14 AC 323 ms
31,620 KB
testcase_15 AC 320 ms
32,444 KB
testcase_16 AC 349 ms
31,844 KB
testcase_17 AC 328 ms
31,936 KB
testcase_18 AC 17 ms
7,844 KB
testcase_19 AC 16 ms
7,820 KB
testcase_20 AC 16 ms
7,816 KB
testcase_21 AC 16 ms
7,820 KB
testcase_22 AC 16 ms
7,948 KB
testcase_23 AC 208 ms
26,920 KB
testcase_24 AC 163 ms
22,252 KB
testcase_25 AC 183 ms
24,704 KB
testcase_26 AC 241 ms
30,332 KB
testcase_27 AC 77 ms
14,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

N,K=map(int,readline().split())
K-=1
A=list(map(int,readline().split()))
L,R=[],[]
l=0
for r in range(1,N):
    if A[r-1]<A[r]:
        for i in range(l,r):
            R.append(i)
        l=r
    elif A[r-1]>A[r]:
        for i in range(l,r):
            L.append(i)
        l=r
lst=L+[i for i in range(l,N)]+R[::-1]
j=lst[K]
ans_lst=[A[i] for i in range(N) if i!=j]
print(*ans_lst)
0