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