結果

問題 No.2210 equence Squence Seuence
コンテスト
ユーザー Mat_h
提出日時 2023-02-10 23:07:02
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 271 ms / 2,000 ms
コード長 738 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 368 ms
コンパイル使用メモリ 20,696 KB
実行使用メモリ 34,152 KB
最終ジャッジ日時 2026-03-29 08:10:53
合計ジャッジ時間 6,029 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code


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