結果
問題 | No.2210 equence Squence Seuence |
ユーザー |
![]() |
提出日時 | 2023-02-10 23:46:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 141 ms / 2,000 ms |
コード長 | 384 bytes |
コンパイル時間 | 210 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 134,828 KB |
最終ジャッジ日時 | 2024-07-07 17:36:46 |
合計ジャッジ時間 | 4,138 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
n,k=map(int,input().split())a=list(map(int,input().split()))front=[]back=[]res=[]for i in range(n-1):if a[i]<a[i+1]:res.append(i)for j in res:back.append(j)res=[]elif a[i]>a[i+1]:res.append(i)for j in res:front.append(j)res=[]else:res.append(i)ord=front+res+[n-1]+back[::-1]ng=ord[k-1]ans=a[:ng]+a[ng+1:]print(*ans)