結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー hanorver
提出日時 2015-10-17 13:14:45
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 512 bytes
コンパイル時間 435 ms
コンパイル使用メモリ 57,852 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 13:39:34
合計ジャッジ時間 1,614 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>

int main() {
	int holiday;
	std::string weeks, s;

	std::cin >> holiday;
	std::cin >> s;
	weeks = s;
	std::cin >> s;
	weeks += s;

	int max = 0;
	for (int i = 0; i < weeks.length(); i++) {
		int count = 0, holi_num = 0;
		for (int j = i; j < weeks.length(); j++) {
			if (weeks[j] == 'x') {
				if (count == holiday) {
					break;
				}
				count++;
			}
			holi_num++;
		}
		max = std::max(max, holi_num);
	}

	std::cout << max << std::endl;
	return 0;
}
0