結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー face4
提出日時 2018-05-11 20:43:33
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 584 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 64,384 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 03:59:44
合計ジャッジ時間 1,876 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
    string s,t;
    int n;
    cin >> n >> s >> t;
    s += t;

    int ans = 0;
    for(int i = 0; i < 14-n+1; i++){
        t = s;
        for(int j = i; j < i+n; j++){
            t[j] = 'o';
        }

        int pos = 0;
        while(pos != 14){
            while(pos != 14 && t[pos] == 'x')    pos++;
            int now = 0;
            while(pos != 14 && t[pos] == 'o'){
                pos++;
                now++;
            }
            ans = max(ans, now);
        }
    }

    cout << ans << endl;
    return 0;
}
0