結果

問題 No.2774 Wake up Record 2
ユーザー ococonomy1ococonomy1
提出日時 2024-06-07 21:36:53
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 2,052 bytes
コンパイル時間 1,227 ms
コンパイル使用メモリ 115,532 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 07:19:33
合計ジャッジ時間 1,853 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <climits>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pli = pair<ll,int>;
#define TEST cerr << "TEST" << endl
#define AMARI 998244353
//#define AMARI 1000000007
#define el '\n'
#define El '\n'
#define MULTI_TEST_CASE false
void solve(void){
//
//
//
//
//
int n;
cin >> n;
int k; cin >> k;
vector<int> a(n);
for(int i = 0; i < n; i++)cin >> a[i];
vector<int> sorta = a;
sort(sorta.begin(),sorta.end());
int key = sorta[k - 1];
string s;
for(int i = 0; i < n; i++){
if(a[i] <= key)s.push_back('x');
else s.push_back('o');
}
vector<int> ans;
for(int i = 0; i < n - 1; i++){
if(s[i] == 'x' && s[i + 1] == 'o')ans.push_back(i);
}
cout << ans.size() << el;
for(int i = 0; i < ans.size(); i++)cout << ans[i] + 2 << ' ';
cout << el;
return;
}
void calc(void){
return;
}
signed main(void){
cin.tie(nullptr);
ios::sync_with_stdio(false);
calc();
int t = 1;
if(MULTI_TEST_CASE)cin >> t;
while(t--){
solve();
}
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0