結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 2 ms
4,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 1 ms
4,376 KB
testcase_35 RE -
testcase_36 RE -
testcase_37 AC 2 ms
4,380 KB
testcase_38 AC 2 ms
4,380 KB
testcase_39 AC 2 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 2 ms
4,376 KB
testcase_46 AC 2 ms
4,376 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++){
            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