結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
![]() |
提出日時 | 2017-07-08 10:39:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 405 bytes |
コンパイル時間 | 1,425 ms |
コンパイル使用メモリ | 170,948 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-06 19:36:52 |
合計ジャッジ時間 | 2,718 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 33 |
ソースコード
#include <bits/stdc++.h> #define REP(i,n,N) for(int i=(n);i<(int) N;i++) #define p(s) cout<<(s)<<endl using namespace std; int main() { int D; string s,s1; cin>>D>>s>>s1; s+=s1; queue<int> q;//num of x q.push(0); int ans=0; REP(i,0,14){ if(s[i]=='x'){ q.push(i+1); } if((int)q.size()>D+1){ ans=max(ans,i-q.front()); q.pop(); } } ans=max(ans,14-q.front()); p(ans); return 0; }