結果

問題 No.2210 equence Squence Seuence
ユーザー Mat_h
提出日時 2023-02-10 23:07:02
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 308 ms / 2,000 ms
コード長 738 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 31,228 KB
最終ジャッジ日時 2024-07-07 17:08:21
合計ジャッジ時間 5,046 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #


def Main():
    n,k=map(int,input().split())
    a=list(map(int,input().split()))
    ans=[0 for _ in range(n)]
    mae=0
    ato=n-1
    b=1
    count=0
    for i in range(n):
        if i==n-1:
            for j in range(count+1):
                ans[mae]=i-j
                mae+=1
        elif a[i]<a[i+1]:
            for j in range(count+1):
                ans[ato]=i-j
                ato-=1
            count=0
        elif a[i]==a[i+1]:
            count+=1
        else:
            for j in range(count+1):
                ans[mae]=i-j
                mae+=1
            count=0
    for i in range(n):
        if i!=ans[k-1]:
            print(a[i],end=" ")
    
    print()
    
    
                    
    
    
Main()

0