結果
問題 |
No.2298 yukicounter
|
ユーザー |
|
提出日時 | 2023-05-12 23:54:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 423 bytes |
コンパイル時間 | 1,882 ms |
コンパイル使用メモリ | 193,224 KB |
最終ジャッジ日時 | 2025-02-12 23:42:41 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for (int i=0;i<(int)(n);i++) int main(){ string s; cin>>s; string y="yukicoder"; int n=s.size(); int ans=0; int ct=0; int cy=0; rep(i,n){ if(s.at(i)==y.at(cy)){ cy++; if(cy==9){ cy=0; ct++; ans=max(ans,ct); } }else{ ct=0; cy=0; } } cout<<ans<<endl; }