結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー kroton
提出日時 2015-05-22 00:08:59
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 353 bytes
コンパイル時間 1,160 ms
コンパイル使用メモリ 161,088 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-13 12:48:43
合計ジャッジ時間 2,320 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 1 WA * 45
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
  int D;
  cin >> D;
  
  string S1, S2;
  cin >> S1 >> S2;
  
  string S = S1 + S2;
  S += "x";
  
  int res = 0;
  int acc = 0;
  
  for(char c : S){
    if(c == 'o'){
      ++acc;
      continue;
    }
    res = max(res, min(D, acc));
    acc = 0;
  }
  
  cout << res << endl;
  return 0;
}
0