結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
![]() |
提出日時 | 2015-05-08 22:43:11 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 719 bytes |
コンパイル時間 | 1,134 ms |
コンパイル使用メモリ | 160,360 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-13 11:36:11 |
合計ジャッジ時間 | 2,276 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 25 |
ソースコード
#include <bits/stdc++.h> int main() { std::string str1, str2, str3; char str[32]; int ans = 0; int d; std::cin >> d; std::cin >> str1 >> str2; str3 += "xxxxxxxxxxxxxx"; str3 += str1; str3 += str2; for(int k = 0; k < 28; ++k) { strcpy(str, str3.c_str()); for(int i = k; i < k+d; ++i) { if( i >= 28 ) { break; } if( str[i] == 'x' ) { str[i] = 'o'; } else { break; } } for(int i = 14; i < 28; ++i) { if( str[i] == 'o' ) { for(int j = i+1; j <= 28; ++j) { if( str[i] != str[j] ) { ans = std::max(ans, j-i); i = j-1; break; } } } } label_1: ans = ans; } std::cout << ans << std::endl; return 0; }