結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-08 10:30:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 639 bytes |
| コンパイル時間 | 4,464 ms |
| コンパイル使用メモリ | 194,184 KB |
| 最終ジャッジ日時 | 2025-01-22 04:53:03 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 WA * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
cin.tie(0);
ios::sync_with_stdio(false);
int D;
string s1, s2;
cin >> D;
cin >> s1;
cin >> s2;
s1 += s2;
string s = "";
for (int i = 0; i < D; i++)
{
s += 'x';
}
s1 = s + s1;
s1 = s1 + s;
int res = 0;
int cnt = 0;
for (int t = 0; t <= s1.length() - D; t++)
{
string s = s1;
for (int i = t; i < t + D; i++)
{
s[i] = 'o';
}
cnt = 0;
for (int i = 0; i < s.length(); i++)
{
if (s[i] == 'o')
{
cnt++;
res = max(res, cnt);
}
else
{
cnt = 0;
}
}
res = max(res, cnt);
}
cout << res << '\n';
return 0;
}