結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー 👑 CleyL
提出日時 2020-03-07 15:40:13
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 474 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 68,300 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-14 16:31:49
合計ジャッジ時間 1,969 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 31 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int d;cin>>d;
  string a,b;cin>>a>>b;
  a+=b;
  int ans = 0;
  for(int i = -d; 14 >= i; i++){
    int tmp = 0;
    int t = -i;
    for(int j = 0; 14 > j; j++){
      if(i <= j && j < i+d){
        t++;
      }else if(a[j] == 'o'){
        t++;
      }else{
        tmp = max(tmp,t);
        t = 0;
      }
    }
    t+=i+d-14;
    tmp = max(tmp,t);
    ans = max(ans,tmp);
  }
  cout << ans << endl;
}
0