結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー tetsuzuki1115tetsuzuki1115
提出日時 2018-02-28 21:09:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,183 bytes
コンパイル時間 917 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-23 12:09:04
合計ジャッジ時間 2,636 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
    int D;
    cin >> D;
    string S[2];
    cin >> S[0] >> S[1];

    int X[14*3] = {0};
    for ( int i = 0; i < 7; i++ ) {
        if ( S[0][i] == 'o' ) { X[i+14] = 1; }
        if ( S[1][i] == 'o' ) { X[i+21] = 1; }
    }

    int ans = 0;
    for ( int i = 0; i+D-1 < 14*3; i++ ) {
        int Y[14*3];
        memcpy( Y, X, sizeof(Y) );
        bool isOK = true;
        for ( int j = 0; j < D; j++ ) {
            if ( Y[i+j] == 0 ) { Y[i+j] = 1; }
            else { isOK = false; break; }
        }
        if ( !isOK ) {
            memcpy( Y, X, sizeof(Y) );
        }

        int a = 0;
        int m = 0;
        
        for ( int j = 0; j < 14*3; j++ ) {
            if ( Y[j] ) {
                a++;
                m = max( m, a );
            }
            else { a = 0; }
        }
        ans = max( ans, m );
    }
    cout << ans << endl;

    return 0;
}
0