結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー face4face4
提出日時 2018-05-11 20:54:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 682 bytes
コンパイル時間 507 ms
コンパイル使用メモリ 67,548 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-10 12:40:57
合計ジャッジ時間 2,726 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,504 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 WA -
testcase_23 AC 1 ms
4,380 KB
testcase_24 WA -
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 1 ms
4,380 KB
testcase_35 RE -
testcase_36 RE -
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 1 ms
4,376 KB
testcase_39 AC 1 ms
4,376 KB
testcase_40 RE -
testcase_41 AC 1 ms
4,376 KB
testcase_42 WA -
testcase_43 RE -
testcase_44 RE -
testcase_45 AC 1 ms
4,380 KB
testcase_46 AC 2 ms
4,380 KB
testcase_47 WA -
testcase_48 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

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

    string x(n-1, 'x');
    s = x+s+x;

    int ans = 0;
    for(int i = 0; i < s.size()-n+1; i++){
        t = s;
        for(int j = i; j < i+n; j++){
            if(t[j] == 'o') break;
            t[j] = 'o';
        }
        int pos = 0;
        while(pos != s.size()){
            while(pos != s.size() && t[pos] == 'x')    pos++;
            int now = 0;
            while(pos != s.size() && t[pos] == 'o'){
                pos++;
                now++;
            }
            ans = max(ans, now);
        }
    }

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