結果

問題 No.2210 equence Squence Seuence
ユーザー 👑 KazunKazun
提出日時 2023-02-10 21:33:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 529 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 114,296 KB
最終ジャッジ日時 2023-09-21 22:37:21
合計ジャッジ時間 5,313 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,176 KB
testcase_01 AC 71 ms
71,380 KB
testcase_02 AC 71 ms
71,380 KB
testcase_03 AC 102 ms
84,048 KB
testcase_04 AC 105 ms
85,480 KB
testcase_05 AC 115 ms
90,592 KB
testcase_06 AC 112 ms
88,376 KB
testcase_07 AC 143 ms
101,460 KB
testcase_08 AC 71 ms
71,208 KB
testcase_09 AC 70 ms
71,340 KB
testcase_10 AC 71 ms
70,984 KB
testcase_11 AC 71 ms
71,124 KB
testcase_12 AC 70 ms
71,048 KB
testcase_13 AC 154 ms
108,844 KB
testcase_14 AC 157 ms
108,584 KB
testcase_15 AC 155 ms
108,696 KB
testcase_16 AC 155 ms
108,496 KB
testcase_17 AC 156 ms
108,672 KB
testcase_18 AC 72 ms
71,224 KB
testcase_19 AC 71 ms
71,332 KB
testcase_20 AC 72 ms
71,304 KB
testcase_21 AC 71 ms
70,940 KB
testcase_22 AC 72 ms
71,136 KB
testcase_23 AC 133 ms
107,080 KB
testcase_24 AC 121 ms
99,496 KB
testcase_25 AC 127 ms
103,108 KB
testcase_26 AC 143 ms
114,296 KB
testcase_27 AC 100 ms
85,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    N,K=map(int,input().split())
    A=list(map(int,input().split()))

    S=[-1]*N
    L,R=1,N
    i=0; j=0
    while i<N:
        if i==N-1 or A[i]>A[i+1]:
            for k in range(j,i+1):
                S[k]=L
                L+=1
            j=i+1
        elif A[i]<A[i+1]:
            for k in range(j,i+1):
                S[k]=R
                R-=1
            j=i+1
        i+=1

    I=S.index(K)
    X=A.copy(); del X[I]
    return X

#==================================================
print(*solve())
0