結果
問題 | No.2774 Wake up Record 2 |
ユーザー |
![]() |
提出日時 | 2024-06-07 22:40:56 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 615 bytes |
コンパイル時間 | 4,088 ms |
コンパイル使用メモリ | 257,288 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 08:57:47 |
合計ジャッジ時間 | 5,067 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
#include<bits/stdc++.h>using namespace std;//#include<atcoder/all>//using namespace atcoder;using ll = long long;using ull = unsigned long long;#define rep(i,n) for(int i=0;i<(n);++i)int main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n,k;cin>>n>>k;vector<int>a(n);for(int i=0;i<n;++i)cin>>a[i];vector<int>b = a;ranges::sort(a);int key = a[k-1];vector<int>ans;for(int i=0;i<n;++i){if(b[i]<=key) continue;ans.emplace_back(i+1);while(i<n && b[i]>key){i++;}}int m = ans.size();cout << m << endl;for(int i=0;i<m;++i)cout << ans[i] << " ";cout << endl;}