結果
| 問題 | No.2298 yukicounter |
| コンテスト | |
| ユーザー |
nyya
|
| 提出日時 | 2023-05-13 16:05:13 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 13 ms / 2,000 ms |
| + 773µs | |
| コード長 | 555 bytes |
| 記録 | |
| コンパイル時間 | 866 ms |
| コンパイル使用メモリ | 183,816 KB |
| 実行使用メモリ | 9,860 KB |
| 最終ジャッジ日時 | 2026-10-01 22:17:18 |
| 合計ジャッジ時間 | 3,573 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
bool chmax(int& a,int b){if(a<b){a=b; return 1;} return 0;}
int main(){
string s;
cin >> s;
int sz = s.size();
string yuki = "yukicoder";
int cnt = 0;
int now = 0;
int ans = 0;
for(int i=0;i<sz;i++) {
if(s[i] == yuki[now]) now++;
else {
cnt = 0;
now = 0;
}
if(now==(int)yuki.size()) {
now=0;
cnt++;
}
chmax(ans,cnt);
}
cout << ans << endl;
return 0;
}
nyya