結果
問題 | No.204 ゴールデン・ウィーク(2) |
ユーザー |
|
提出日時 | 2016-12-28 00:07:23 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 797 bytes |
コンパイル時間 | 1,191 ms |
コンパイル使用メモリ | 82,900 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 11:57:16 |
合計ジャッジ時間 | 2,375 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 46 |
ソースコード
#define _USE_MATH_DEFINES #include<stdio.h> #include<string> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include<iomanip> //#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string a, b; cin >> a >> b; string h = "xxxxxxx"; string g = h+h+a + b+h+h; //cout<<g; int s = 0; for (int i = 0; i < g.size(); i++) { int x = 0; string p = g; for (int j = i; j < i+n; j++) { if (p[j] == 'x') { p[j] = 'o'; } else break; if (j == g.size() - 1)break; } int y = 0; for (int j = 0; j < p.size(); j++) { if (p[j] == 'o')y++; else y = 0; s = max(s, y); } } cout << s << endl; return 0; }