結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
latte0119
|
| 提出日時 | 2015-05-16 19:17:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 609 bytes |
| コンパイル時間 | 1,209 ms |
| コンパイル使用メモリ | 160,508 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-13 12:48:00 |
| 合計ジャッジ時間 | 2,315 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 25 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int f(string str){
int ma=0;
int cur=0;
while(cur<str.size()){
int cnt=0;
while(cur<str.size()&&str[cur]=='o')cur++,cnt++;
ma=max(ma,cnt);
while(cur<str.size()&&str[cur]=='x')cur++;
}
return ma;
}
int main(){
int D;
string str;
cin>>D;
for(int i=0;i<2;i++){
string s;cin>>s;str+=s;
}
int ans=0;
for(int i=0;i<str.size();i++){
string s=str;
for(int j=0;j<D&&i+j<str.size()&&s[i+j]=='x';j++)s[i+j]='o';
ans=max(ans,f(s));
}
cout<<ans<<endl;
}
latte0119