結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー moti
提出日時 2015-07-26 16:14:47
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 679 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 80,572 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-13 13:31:28
合計ジャッジ時間 1,710 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <complex>
#include <queue>
#include <set>
#include <map>

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;

int main() {

  int D; cin >> D;
  char c[42];
  rep(i, 42) c[i] = 'x';
  REP(i, 14, 28) { cin >> c[i]; }

  int ans = 0;

  rep(i, 42) {

    int cnt1 = 0;
    for(int j=i-1; j>=0; j--) {
      if(c[j] == 'x') { break; }
      cnt1 ++;
    }

    int cnt2 = 0;
    REP(j, i+D, 42) {
      if(c[j] == 'x') { break; }
      cnt2 ++;
    }
    ans = max(ans, cnt1 + cnt2 + D);
  }

  cout << ans << endl;

  return 0;
}
0