結果

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

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;

typedef modint998244353 mint;
typedef long long ll;

int main(){
	string s;
	cin >> s;
	int n = s.size();
	int i = 0;
	int ans = 0;
	int now = 0;
	string t = "yukicoder";
	while (i < n){
		if (i+8 >= n) break;
		bool mode = true;
		for (int j=0; j<7; j++){
			if (t[j] != s[i+j]) mode = false;
		}
		if (mode){
			now++;
			ans = max(ans, now);
			i += 9;
		}else{
			now = 0;
			i++;
		}
	}
	cout << ans << endl;
}
0