結果

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

ソースコード

diff #

#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
using namespace std;

int main()
{
    int d;
    cin >> d;
    string s(14, ' ');
    for(int i=0; i<14; ++i)
        cin >> s[i];

    int ans = 0;
    for(int i=0; i<=14-d; ++i){
        string t = s;
        for(int j=0; j<d; ++j)
            t[i+j] = 'o';

        int len = 0;
        for(int j=0; j<14; ++j){
            if(t[j] == 'o')
                ++ len;
            else
                len = 0;
            ans = max(ans, len);
        }
    }
    cout << ans << endl;

    return 0;
}
0