結果
問題 |
No.203 ゴールデン・ウィーク(1)
|
ユーザー |
![]() |
提出日時 | 2019-01-09 00:14:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 398 bytes |
コンパイル時間 | 635 ms |
コンパイル使用メモリ | 68,436 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-24 00:51:46 |
合計ジャッジ時間 | 1,610 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 5 |
ソースコード
#include <iostream> #include <string> #include <algorithm> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { string S1, S2, C; cin >> S1 >> S2; C = S1 + S2; int ans = 0, cnt = 0, n = C.length(); rep(i, n) { cnt = max(cnt, (int)(C[i] == 'o')); cnt = i != n && C[i] == 'o' && C[i] == C[i + 1] ? cnt + 1 : 0; ans = max(ans, cnt); } cout << ans << endl; }