結果
問題 |
No.2773 Wake up Record 1
|
ユーザー |
|
提出日時 | 2023-12-26 21:09:45 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 918 bytes |
コンパイル時間 | 1,296 ms |
コンパイル使用メモリ | 125,464 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-24 17:46:35 |
合計ジャッジ時間 | 2,017 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <iostream> #include <iomanip> #include <string> #include <stdio.h> #include <algorithm> #include <vector> #include <tuple> #include <map> #include<set> #include<queue> #include<stack> #include <unordered_set> //#include<bits/stdc++.h> //cout << fixed << setprecision(3) // static_cast<double>( ) //if(a < 0 || h <= a || b < 0 || w <= b)return; // string abc = "abcdefghijklmnopqrstuvwxyz"; // string abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; using namespace std; using ulli = unsigned long long int; using lli = long long int; int main(){ int n; string s; cin >> n >> s; int ans = 0; vector<int> anss(0); for (int j = 1; j < n; j++) { if (s.substr(j - 1, 2) == "xo") { ans++; anss.push_back(j + 1); } } cout << ans << endl; for (int j = 0; j < anss.size(); j++) { cout << anss[j] << " "; } cout << endl; return 0; }