結果
問題 | No.2774 Wake up Record 2 |
ユーザー |
|
提出日時 | 2024-06-07 22:58:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 18 ms / 2,000 ms |
コード長 | 608 bytes |
コンパイル時間 | 2,099 ms |
コンパイル使用メモリ | 172,328 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 09:36:07 |
合計ジャッジ時間 | 2,757 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int,int> P;#define REP(i,n) for(int i=0;i<int(n);i++)int main(){cin.tie(nullptr); ios_base::sync_with_stdio(false);int i,j,k;int N,K;cin >> N >> K;vector<int> a(N+1,0),b(N);for(i=0;i<N;i++){cin >> b[i];a[i+1]=b[i];}sort(b.begin(),b.end());int x=b[K-1];vector<int> v;for(i=2;i<=N;i++){if(a[i-1]<=x && a[i]>x) v.push_back(i);}cout << (int)v.size() << endl;REP(i,v.size()) cout << v[i] << ' ';cout << endl;return 0;}