結果

問題 No.2298 yukicounter
ユーザー kpinkcat
提出日時 2023-09-24 23:19:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 606 bytes
コンパイル時間 1,759 ms
コンパイル使用メモリ 194,812 KB
最終ジャッジ日時 2025-02-17 02:13:42
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;


int main()
{
    string s, yuki = "yukicoder";
    cin >> s;
    int n, i = 0, cnt = 0, max1 = 0;
    n = s.size();
    while (n){
        if (s.substr(i, 9) == yuki){
            cnt++;
            i += 9;
            n -= 9;
            max1 = max(max1, cnt);
        } else {
            cnt = 0;
            i++;
            n--;
        }
    }
    cout << max1 << endl;
}

0