結果
| 問題 | 
                            No.2773 Wake up Record 1
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-06-08 14:29:00 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 8 ms / 2,000 ms | 
| コード長 | 387 bytes | 
| コンパイル時間 | 3,954 ms | 
| コンパイル使用メモリ | 168,512 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-27 23:57:56 | 
| 合計ジャッジ時間 | 3,031 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 22 | 
ソースコード
#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> ans;
  rep(i, N-1) {
    int k = i+1;
    if (S[k-1] == 'x' && S[k] == 'o')
      ans.push_back(k+1);
  }
  cout << ans.size() << endl;
  rep(i, ans.size())
    cout << ans[i] << " ";
  cout << endl;
  return 0;
}