結果

問題 No.2298 yukicounter
ユーザー tnakao0123tnakao0123
提出日時 2023-06-04 02:07:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 607 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 42,408 KB
実行使用メモリ 7,764 KB
最終ジャッジ日時 2023-08-28 08:07:08
合計ジャッジ時間 2,539 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,060 KB
testcase_01 AC 2 ms
5,076 KB
testcase_02 AC 2 ms
4,996 KB
testcase_03 AC 9 ms
7,468 KB
testcase_04 AC 5 ms
5,980 KB
testcase_05 AC 2 ms
5,180 KB
testcase_06 AC 10 ms
7,712 KB
testcase_07 AC 5 ms
5,796 KB
testcase_08 AC 3 ms
5,216 KB
testcase_09 AC 3 ms
5,472 KB
testcase_10 AC 2 ms
5,172 KB
testcase_11 AC 4 ms
5,644 KB
testcase_12 AC 4 ms
5,568 KB
testcase_13 AC 4 ms
5,728 KB
testcase_14 AC 3 ms
5,764 KB
testcase_15 AC 2 ms
5,100 KB
testcase_16 AC 3 ms
5,288 KB
testcase_17 AC 2 ms
5,116 KB
testcase_18 AC 2 ms
4,996 KB
testcase_19 AC 2 ms
4,988 KB
testcase_20 AC 2 ms
5,024 KB
testcase_21 AC 2 ms
4,992 KB
testcase_22 AC 3 ms
5,888 KB
testcase_23 AC 4 ms
5,652 KB
testcase_24 AC 10 ms
7,764 KB
testcase_25 AC 6 ms
6,796 KB
testcase_26 AC 3 ms
5,472 KB
testcase_27 AC 8 ms
7,528 KB
testcase_28 AC 3 ms
5,532 KB
testcase_29 AC 3 ms
5,368 KB
testcase_30 AC 2 ms
5,000 KB
testcase_31 AC 2 ms
5,252 KB
testcase_32 AC 3 ms
5,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 2298.cc:  No.2298 yukicounter - yukicoder
 */

#include<cstdio>
#include<cstring>
#include<algorithm>
 
using namespace std;

/* constant */

const int MAX_N = 1000000;
const int L = 9;
const char t[] = "yukicoder";

/* typedef */

/* global variables */

char s[MAX_N + 4];
int dp[MAX_N + 1];

/* subroutines */

/* main */

int main() {
  scanf("%s", s);
  int n = strlen(s);

  int maxc = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == t[dp[i] % L]) {
      dp[i + 1] = dp[i] + 1;
      maxc = max(maxc, dp[i + 1] / L);
    }
  }

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