結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2015-12-20 01:05:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 631 bytes |
| コンパイル時間 | 512 ms |
| コンパイル使用メモリ | 62,552 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-13 13:44:56 |
| 合計ジャッジ時間 | 1,800 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 WA * 6 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int c(string w) {
int d = 0, ret = 0;
for(int i = 0; i < 42; i++) {
if(w[i] == 'o') d++;
else d = 0;
ret = max(ret, d);
}
return ret;
}
int main() {
int d;
string w, w1, w2;
cin >> d >> w1 >> w2;
w = "xxxxxxxxxxxxxx" + w1 + w2 + "xxxxxxxxxxxxxx";
int ans = 0;
for(int i = 0; i <= 28; i++) {
string ww = w;
bool flag = true;
for(int j = 0; j < d; j++) {
if(ww[i + j] == 'o') {
flag = false;
break;
}
ww[i + j] = 'o';
}
if(flag) {
ans = max(ans, c(ww));
}
}
cout << ans << endl;
}
femto