結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
👑 |
提出日時 | 2020-03-07 15:42:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 557 bytes |
コンパイル時間 | 537 ms |
コンパイル使用メモリ | 67,328 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-14 16:35:59 |
合計ジャッジ時間 | 1,883 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 WA * 11 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main(){ int d;cin>>d; string a,b;cin>>a>>b; a+=b; int ans = 0; for(int i = -d; 14 >= i; i++){ int tmp = 0; int t = max(0,-i); for(int j = 0; 14 > j; j++){ if(i <= j && j < i+d){ //cout << "o"; t++; }else if(a[j] == 'o'){ //cout << "o"; t++; }else{ //cout << "x"; tmp = max(tmp,t); t = 0; } } t+=max(0,i+d-14); tmp = max(tmp,t); ans = max(ans,tmp); } cout << ans << endl; }