結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
hanorver
|
| 提出日時 | 2015-10-17 13:18:02 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 543 bytes |
| コンパイル時間 | 475 ms |
| コンパイル使用メモリ | 57,972 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-13 13:39:38 |
| 合計ジャッジ時間 | 1,586 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 WA * 30 |
ソースコード
#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++;
}
holi_num += holiday - count;
max = std::max(max, holi_num);
}
std::cout << max << std::endl;
return 0;
}
hanorver