結果

問題 No.2298 yukicounter
ユーザー as277575
提出日時 2023-05-12 22:15:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 626 bytes
コンパイル時間 904 ms
コンパイル使用メモリ 107,616 KB
最終ジャッジ日時 2025-02-12 23:03:55
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <set>

using namespace::std;




int main() {
  ios::sync_with_stdio(false);
  string s, p = "yukicoder";
  cin >> s;
  int r = 0;
  for (int i = 0; i < s.size();) {
    // cerr << "r = " << r << " i = " << i << " " << s.substr(i) << endl;
    int j = 0;
    for (; i + j < s.size() && s[i + j] == p[j % p.size()]; ++j);
    r = max<int>(r, j / p.size());
    i += max(1, j);
  }
  
  cout << r << endl;

  
  return 0;
}
0