結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
![]() |
提出日時 | 2020-04-11 12:16:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 474 bytes |
コンパイル時間 | 1,660 ms |
コンパイル使用メモリ | 169,260 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-18 21:22:50 |
合計ジャッジ時間 | 3,154 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 WA * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; template<typename T> void chmax(T &a,T b){ if(a<b)a=b; } signed main(){ int d;cin>>d; string s,t;cin>>s>>t;s+=t; s="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"+s+"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; int ans=0; for(int i=0;i<s.size()-20;i++){ int tmp=0; t=s;for(int j=i;j<i+d;j++)t[j]='o'; for(char p:t){ if(p=='o')chmax(ans,++tmp); else tmp=0; } } cout<<ans<<endl; }