結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
|
提出日時 | 2019-08-08 23:56:40 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 653 bytes |
コンパイル時間 | 2,204 ms |
コンパイル使用メモリ | 193,936 KB |
最終ジャッジ日時 | 2025-01-07 11:03:41 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 41 TLE * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int d; string s,t; cin>>d>>s>>t; s+=t; s="xxxxxxxxxxxxxx"+s+"xxxxxxxxxxxxxx"; int n=s.size(); int mx=0; for (int i=0;i<n;i++) { int k=0; for (int j=0;j<n;j++) { if (j==i&&s[j]=='x') { while (j<n&&j<i+d&&s[j]=='x') { k++; j++; } j--; } else if (s[j]=='o') { k++; } else { k=0; } mx=max(mx,k); } } cout<<mx<<endl; return 0; }