結果
| 問題 | No.204 ゴールデン・ウィーク(2) |
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2016-08-16 22:11:50 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 643 bytes |
| 記録 | |
| コンパイル時間 | 571 ms |
| コンパイル使用メモリ | 84,748 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-30 08:03:59 |
| 合計ジャッジ時間 | 1,869 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 46 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int d,ans;
int main()
{
int cnt = 0;
vector<bool> tf;
tf.resize(42);
cin >> d;
for (int i = 14; i < 28; i++) {
char c;
cin >> c;
if (c == 'o') tf[i] = true;
}
for (int i = 0; i < 29; i++) {
if (!tf[i]) {
vector<bool>tf2;
tf2 = tf;
for (int j = 0; j < d; j++) {
if(!tf2[i+j]) tf2[i+j] = true;
else break;
}
cnt = 0;
for (int k = 0; k < 42; k++) {
if (tf2[k]) cnt++;
else {
ans = max(ans, cnt);
cnt=0;
}
}
ans = max(ans, cnt);
}
}
cout << ans << endl;
return 0;
}
kurenai3110