結果
問題 | No.203 ゴールデン・ウィーク(1) |
ユーザー |
|
提出日時 | 2021-03-16 11:29:43 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 722 bytes |
コンパイル時間 | 1,749 ms |
コンパイル使用メモリ | 166,556 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 21:38:49 |
合計ジャッジ時間 | 2,641 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) int main(void) { string s, t; cin >> s >> t; string u = s + t; int cur = 0, nowh = 0, maxh = 0; while (cur < u.size()) { if (u[cur] == 'o') { while (true) { if (cur >= u.size()) { maxh = max(maxh, nowh); nowh = 0; break; } else if (u[cur] == 'o') { nowh++; } else if (u[cur] != 'o') { maxh = max(maxh, nowh); nowh = 0; break; } cur++; } } else if (u[cur] != 'o') { cur++; } } cout << maxh << endl; return 0; }