結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
![]() |
提出日時 | 2015-08-01 23:55:53 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 524 bytes |
コンパイル時間 | 663 ms |
コンパイル使用メモリ | 59,516 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 13:32:09 |
合計ジャッジ時間 | 1,742 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 WA * 6 |
ソースコード
#include <iostream> #include <algorithm> using namespace std; int main(){ int d; cin>>d; string a,b,c; cin>>a; cin>>b; c="xxxxxxxxxxxxxx"; a=c+a+b+c;//14*3=42words int cnt=0,ans=0; for(int i=0;i+d<=42;i++){ b=a; bool flag=false; for(int j=0;j<d;j++){ if(b[i+j]=='o') flag=true; b[i+j]='o'; } if(flag) continue; cnt=0; for(int j=0;j<42;j++){ if(b[j]=='x'){ ans=max(ans,cnt); cnt=0; } else if(b[j]=='o') cnt++; } ans=max(ans,cnt); b.clear(); } cout<<ans<<endl; return 0; }