結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2015-12-20 00:58:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 533 bytes |
| コンパイル時間 | 610 ms |
| コンパイル使用メモリ | 62,568 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-13 13:44:54 |
| 合計ジャッジ時間 | 1,745 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 WA * 11 |
ソースコード
#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;
for(int j = 0; j < d; j++) {
ww[i + j] = 'o';
}
ans = max(ans, c(ww));
}
cout << ans << endl;
}
femto