結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
kpinkcat
|
| 提出日時 | 2023-11-06 02:23:41 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 765 bytes |
| コンパイル時間 | 2,070 ms |
| コンパイル使用メモリ | 194,424 KB |
| 最終ジャッジ日時 | 2025-02-17 19:47:17 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 25 |
ソースコード
#include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<math.h>
#include<bitset>
using ll = long long;
using namespace std;
int main(){
int n, ans = -1;
string days, s;
cin >> n >> days >> s;
days += s;
for (int i = 0; i < 13 - n; i++) {
string tmp = days;
int cnt = 0;
for (int j = i; j < i + n; j++){
tmp[j] = 'o';
}
for (int j = 0; j < 14; j++){
if (tmp[j] == 'o') cnt++;
else {
ans = max(ans, cnt);
cnt = 0;
}
if (j == 13 && cnt) ans = max(ans, cnt);
}
}
cout << ans << endl;
}
kpinkcat