結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー Mayimg
提出日時 2019-01-19 07:59:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 501 bytes
コンパイル時間 1,622 ms
コンパイル使用メモリ 166,484 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-08 08:06:37
合計ジャッジ時間 4,313 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 25 TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int d;
	cin >> d;
	string s;
	for (int i = 0; i < 2; i++) {
		string t;
		cin >> t;
		s += t;
	}
	int ans = 0;
	for (int i = 0; i <= 14 - d; i++) {
		int cnt = 0;
		for (int j = 0; j < 14; j++) {
			if(j == i) {
				cnt += d;
				j += d - 1;
				continue;
			}
			if(s[j] == 'o') cnt++;
			else cnt = 0;
			ans = max(ans, cnt);
		}
	}
	cout << ans << endl;
	return 0;
}
0