結果

問題 No.306 さいたま2008
ユーザー aa
提出日時 2016-07-10 00:32:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 750 bytes
コンパイル時間 595 ms
コンパイル使用メモリ 50,492 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-21 11:08:52
合計ジャッジ時間 3,257 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 WA -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 WA -
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>

using namespace std;

int main(void) {
  int d;
  char s[111], t[111];
  memset(s, 'x', sizeof(s));
  scanf("%d", &d);
  scanf("%s", s+14);
  scanf("%s", s+14+7);
  s[14+7+7] = 'x';

  int res = 0;
  for (int i = 0; i < 77; i++) {
    memcpy(t, s, sizeof(s));

    bool o = false;
    
    for (int j = 0; j < d; j++) {
      if (s[i+j] == 'o')o=true;
      s[i+j] = 'o';
    }

    if (!o) {
      for (int j = 0; j < 99; j++) {
        if (s[j] == 'o') {
          int c = 1;
          while (s[j+c] == 'o') {
            c++;
          }
          res = max(res, c);
        }
      }
    }
    
    memcpy(s, t, sizeof(t));
  }

  printf("%d\n", res);
  
  return 0;
}
0