結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー e-mon
提出日時 2015-05-09 13:40:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 785 bytes
コンパイル時間 1,405 ms
コンパイル使用メモリ 158,168 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-10-13 12:08:57
合計ジャッジ時間 3,994 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1 TLE * 1
other AC * 2 WA * 2 -- * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
#define INF 1e9

int main(){
    const int N =14;
    char days[N];
    int D;
    cin >> D ;
    for(int i =0;i<N;i++)
        cin >> days[i] ;

    int l = 0;
    int ans=0;
    while(l<N){
        int count = D;
        int holiday = 0;
        for(;l<N;l++){
            holiday++;
            if(days[l] == 'x')
                count--;
            else if(count!=D && days[l]=='o')
                count = 0;
            if(count<0){
                l--;
                break;
            }
        }
        ans = max(ans,holiday);
    }
    cout << ans  << endl;

    return 0;
}
0