結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
tetsuzuki1115
|
| 提出日時 | 2018-02-28 21:06:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,159 bytes |
| コンパイル時間 | 941 ms |
| コンパイル使用メモリ | 84,596 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-21 14:51:16 |
| 合計ジャッジ時間 | 2,649 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 39 WA * 7 |
ソースコード
#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 < 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;
}
tetsuzuki1115