結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1 ms
4,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
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 1 ms
4,380 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 1 ms
4,376 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,376 KB
testcase_37 AC 2 ms
4,380 KB
testcase_38 AC 2 ms
4,380 KB
testcase_39 WA -
testcase_40 AC 2 ms
4,376 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 2 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,380 KB
testcase_47 WA -
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++ ) {
    for ( int i = 14; i+D-1 < 14*2; 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