結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー kyo1
提出日時 2020-03-29 13:33:25
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 504 bytes
コンパイル時間 1,512 ms
コンパイル使用メモリ 161,492 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-01-02 13:24:40
合計ジャッジ時間 2,379 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string S;
  for (int i = 0; i < 2; i++) {
    string s;
    cin >> s;
    S += s;
  }
  if (S.find('o') == string::npos) {
    cout << 0 << '\n';
    return 0;
  }
  int res = 0, cnt = 0;
  for (int i = 0; i < (int)S.size() - 1; i++) {
    if (S[i] == S[i + 1] && S[i] == 'o') {
      cnt++;
    } else {
      cnt = 0;
    }
    res = max(res, cnt);
  }
  cout << res + 1 << '\n';
  return 0;
}
0