結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー nanophoto12
提出日時 2016-02-19 21:23:46
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,097 bytes
コンパイル時間 523 ms
コンパイル使用メモリ 65,988 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 13:53:23
合計ジャッジ時間 1,628 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <queue>
#include <algorithm>
#include <vector>
#include <iostream>
#include <numeric>
#include <tuple>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define ALL(container) (container).begin(), (container).end()

int main(int argc, char *argv[]){
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    string p = "xxxxxxxxxxxxxx";
    string f;
    string s;
    cin >> f;
    cin >> s;
    const string m = p + f + s + p;
    int maxValue = 0;
    for(int i = 0; i < m.length();i++)
    {
        int current = 0;
        for(int j = 0;j < m.length();j++)
        {
            if(j >= i && j < i + n)
            {
                current++;
                maxValue = max(maxValue, current);
            }
            else if(m[j] == 'o')
            {
                current++;
                maxValue = max(maxValue, current);
            }
            else
            {
                current = 0;
            }
        }
    }
    cout << maxValue << endl;
    return 0;
}
0