結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 WA -
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 WA -
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 WA -
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,376 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 1 ms
4,380 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 1 ms
4,380 KB
testcase_36 AC 2 ms
4,500 KB
testcase_37 AC 1 ms
4,376 KB
testcase_38 AC 2 ms
4,380 KB
testcase_39 AC 1 ms
4,380 KB
testcase_40 AC 1 ms
4,376 KB
testcase_41 WA -
testcase_42 AC 1 ms
4,376 KB
testcase_43 AC 1 ms
4,376 KB
testcase_44 AC 2 ms
4,376 KB
testcase_45 AC 2 ms
4,380 KB
testcase_46 AC 2 ms
4,376 KB
testcase_47 AC 1 ms
4,380 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+7] = 1; }
        if ( S[1][i] == 'o' ) { X[i+14] = 1; }
    }

    int ans = 0;
    for ( int i = 0; i+D < 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; }
        }
        int a = 0;
        int m = 0;
        if ( isOK ) {
            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