結果
問題 | No.2298 yukicounter |
ユーザー |
![]() |
提出日時 | 2024-11-08 00:39:36 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 455 bytes |
コンパイル時間 | 2,058 ms |
コンパイル使用メモリ | 193,744 KB |
最終ジャッジ日時 | 2025-02-25 02:31:28 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); string s; cin >> s; int n = s.size(); string yukicoder = "yukicoder"; int ans = 0; int cnt = 0, j = 0; for (int i = 0; i < n; i++) { if (s[i] == yukicoder[j]) { j++; if (j == 9) { cnt++; j = 0; } } else { cnt = 0; j = 0; } ans = max(ans, cnt); } cout << ans << endl; }