結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
fal_rnd
|
| 提出日時 | 2017-02-18 13:35:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 956 bytes |
| コンパイル時間 | 1,788 ms |
| コンパイル使用メモリ | 160,228 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-30 03:59:36 |
| 合計ジャッジ時間 | 2,723 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 WA * 8 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,s,g) for(int i=s;i<g;i++)
#define REP(i, n) for(int i=0;i<n;i++)
using ull = unsigned long long;
using ll = long long;
const char en = '\n';
const ull INFL = 810000001919114514;
const ull INF = 1919114514;
int d;
using D = vector<int>;
D in;
int main(){
cin.tie();ios::sync_with_stdio(false);
cin>>d;
char curc='x',buf;
int curv=114514;
REP(i,14){
cin>>buf;
if(buf==curc){
curv++;
}else{
curc=buf;
in.push_back(curv);
curv=1;
}
}
if(curc=='x'){
in.push_back(curv+114514);
}else{
in.push_back(curv);
in.push_back(114514);
}
if(in.size()==1){
cout<<d<<en;
}
/*
for(int i=0;i<in.size();i++){
cout<<in[i]<<' ';
}
cout<<en;
*/
int result=0;
for(int i=2;i<in.size();i+=2){
if(in[i]<=d){
result=max(result,in[i-1]+in[i]+in[i+1]);
}else{
result=max(result,in[i-1]+d);
}
}
cout<<result<<en;
return 0;
}
fal_rnd