結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
![]() |
提出日時 | 2015-08-01 23:56:51 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 483 bytes |
コンパイル時間 | 531 ms |
コンパイル使用メモリ | 59,612 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 13:32:11 |
合計ジャッジ時間 | 1,756 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 WA * 11 |
ソースコード
#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; for(int j=0;j<d;j++){ if(b[i+j]=='o') continue; b[i+j]='o'; } 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; }