結果

問題 No.2210 equence Squence Seuence
コンテスト
ユーザー Mat_h
提出日時 2023-02-10 23:07:02
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 211 ms / 2,000 ms
+ 601µs
コード長 738 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 256 ms
コンパイル使用メモリ 14,720 KB
実行使用メモリ 31,508 KB
最終ジャッジ日時 2026-10-20 08:28:41
合計ジャッジ時間 5,544 ms
ジャッジサーバーID
(参考情報)
judge6_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

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