結果
問題 | No.2210 equence Squence Seuence |
ユーザー |
![]() |
提出日時 | 2023-02-10 21:31:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 79 ms / 2,000 ms |
コード長 | 533 bytes |
コンパイル時間 | 1,742 ms |
コンパイル使用メモリ | 198,192 KB |
最終ジャッジ日時 | 2025-02-10 12:16:51 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define int long longsigned main(){int N,K;cin>>N>>K;bool p = true;deque<int> q;vector<int> S(N);for(int i=0;i<N;i++) cin>>S[i];q.push_back(N-1);for(int i=N-2;i>=0;i--){if(S[i] < S[i+1] || (S[i] == S[i+1] && p)){q.push_back(i);p = true;}else{q.push_front(i);p = false;}}for(int i=0;i<K-1;i++) q.pop_front();for(int i=0;i<N;i++)if(i != q.front()) cout<<S[i]<<' ';cout<<endl;}