結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
![]() |
提出日時 | 2015-05-20 13:48:38 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 854 bytes |
コンパイル時間 | 723 ms |
コンパイル使用メモリ | 83,708 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 12:48:28 |
合計ジャッジ時間 | 1,962 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 25 |
ソースコード
#include <algorithm> #include <vector> #include <cfloat> #include <string> #include <cmath> #include <set> #include <cstdlib> #include <map> #include <ctime> #include <iomanip> #include <functional> #include <deque> #include <iostream> #include <cstring> #include <queue> #include <cstdio> #include <stack> #include <climits> #include <sys/time.h> #include <cctype> using namespace std; typedef long long ll; int main() { int d; cin >> d; string s, t; cin >> s; cin >> t; s += t; t = s; int ans = 0, cnt = 0; for (int p = 0; p < s.size()-d+1; p++) { for (int i = 0; i < d; i++) { s[p+i] = 'o'; } cnt = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == 'o') { cnt++; }else { ans = max(ans, cnt); cnt = 0; } } ans = max(ans, cnt); s = t; } std::cout << ans << std::endl; }