結果

問題 No.2774 Wake up Record 2
ユーザー rieaaddlreiuu
提出日時 2024-06-07 23:20:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 557 bytes
コンパイル時間 1,796 ms
コンパイル使用メモリ 171,152 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 10:27:56
合計ジャッジ時間 3,155 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 14 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
    int N,K,a;
    cin >> N >> K;
    vector<int> A(N),X(N);
    for(int i=0;i<N;i++){
        cin >> a;
        A[i] = a;
        X[i] = a;
    }
    sort(X.begin(),X.end());
    int thereshold = X[K-1];
    int count = 0;
    for(int k=1;k<N;k++){
        if(A[k] > thereshold && A[k-1] <= thereshold){
            count++;
        }
    }
    cout << count << endl;
    for(int k=1;k<N;k++){
        if(A[k] > thereshold && A[k-1] <= thereshold){
            cout << k+1 << " ";
        }
    }
}
0