結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
izryt(趣味)
|
| 提出日時 | 2016-01-14 04:53:43 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 743 bytes |
| コンパイル時間 | 1,095 ms |
| コンパイル使用メモリ | 56,880 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-13 13:50:27 |
| 合計ジャッジ時間 | 6,142 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 RE * 2 |
| other | AC * 7 RE * 39 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int f(string a)
{
a += "x";
int ma = 0;
bool st = true;
int s;
for (int i = 0; i < a.size(); ++i) {
if (st && a[i] == 'o') {
s = i;
st = false;
} else if (!st && a[i] == 'x') {
ma = max(ma, i - s);
st = true;
}
}
return ma;
}
int main()
{
int d; cin >> d;
string a(14, 'x');
string s = a;
for (int i = 0; i < 2; ++i) { string t; cin >> t; s += t; }
s += a;
int ma = 0;
for (int i = 0; i < s.size() + 14; ++i) {
string t = s;
for (int j = 0; j < d; ++j) t[i+j] = 'o';
ma = max(ma, f(t));
}
cout << ma << endl;
}
izryt(趣味)