結果
| 問題 | No.2298 yukicounter |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-15 12:30:25 |
| 言語 | D (dmd 2.113.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 5 ms / 2,000 ms |
| + 939µs | |
| コード長 | 764 bytes |
| 記録 | |
| コンパイル時間 | 3,831 ms |
| コンパイル使用メモリ | 172,300 KB |
| 実行使用メモリ | 9,912 KB |
| 最終ジャッジ日時 | 2026-10-15 12:30:37 |
| 合計ジャッジ時間 | 7,166 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
import std;
void main () {
string S = readln.chomp;
const int N = S.length.to!int;
string y = "yukicoder";
const int M = y.length.to!int;
int ans = 0;
int l = 0, r = 0;
while (l < N) {
int cnt = 0;
while (r < N) {
if (S[r .. min(N, r + M)] != y) {
break;
}
cnt++;
r += M;
}
ans = max(ans, cnt);
if (l == r) {
l++;
r++;
}
else {
l = r;
}
}
writeln(ans);
}
void read (T...) (string S, ref T args) {
import std.conv : to;
import std.array : split;
auto buf = S.split;
foreach (i, ref arg; args) {
arg = buf[i].to!(typeof(arg));
}
}