結果

問題 No.2773 Wake up Record 1
ユーザー kakao745
提出日時 2024-06-07 22:09:18
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 3,111 ms
コンパイル使用メモリ 246,300 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 08:14:34
合計ジャッジ時間 3,581 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 21 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)

int main(){
	int n;
	cin >> n;
	string S;
	cin >> S;
	vector<int> a;
	int count=0;
	if(S.at(0)=='o'){
		count++;
		a.push_back(1);
	}
	for(int i=1;i<n;i++){
		if(S.at(i)=='o' and S.at(i-1)=='x'){
			count++;
			a.push_back(i+1);
		}	
	}
	cout << count << endl;
	rep(i,a.size()){
		if(i+1==a.size())cout << a[i] << endl;
		else cout << a[i] << " ";
	}
}
0