結果

問題 No.2298 yukicounter
ユーザー kotatsugame
提出日時 2023-05-12 21:23:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 619 ms
コンパイル使用メモリ 65,620 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-28 17:09:12
合計ジャッジ時間 1,633 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
const string T="yukicoder";
string S;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin>>S;
	int ans=0;
	for(int i=0;i<S.size();)
	{
		if(S[i]!=T[0])
		{
			i++;
			continue;
		}
		int j=i+1;
		while(j<S.size()&&S[j]==T[(j-i)%9])j++;
		ans=max(ans,j-i);
		i=j;
	}
	cout<<ans/9<<endl;
}
0