結果
| 問題 | 
                            No.2773 Wake up Record 1
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-07-03 18:37:16 | 
| 言語 | C++23  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 7 ms / 2,000 ms | 
| コード長 | 483 bytes | 
| コンパイル時間 | 3,141 ms | 
| コンパイル使用メモリ | 247,168 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-03 18:37:21 | 
| 合計ジャッジ時間 | 4,557 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 22 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
    int N; cin >> N;
    string S; cin >> S;
    vector<int> ans;
    for(int i = 0; i < N; i++) {
        if(i == 0) {
            if(S[i] == 'o') ans.push_back(i + 1);
        }else {
            if(S[i - 1] == 'x' && S[i] == 'o') ans.push_back(i + 1);
        }
    }
    cout << int(ans.size()) << endl;
    for(auto a: ans) {
        cout << a << " ";
    }cout << endl;
}