結果
問題 | No.2298 yukicounter |
ユーザー | 👑 kakel-san |
提出日時 | 2023-07-27 08:43:13 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 38 ms / 2,000 ms |
コード長 | 995 bytes |
コンパイル時間 | 837 ms |
コンパイル使用メモリ | 114,884 KB |
実行使用メモリ | 28,364 KB |
最終ジャッジ日時 | 2024-04-14 21:30:14 |
合計ジャッジ時間 | 3,360 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 23 ms
23,604 KB |
testcase_01 | AC | 23 ms
21,428 KB |
testcase_02 | AC | 23 ms
23,860 KB |
testcase_03 | AC | 34 ms
27,228 KB |
testcase_04 | AC | 26 ms
23,792 KB |
testcase_05 | AC | 24 ms
23,472 KB |
testcase_06 | AC | 38 ms
25,964 KB |
testcase_07 | AC | 26 ms
21,560 KB |
testcase_08 | AC | 24 ms
23,428 KB |
testcase_09 | AC | 25 ms
23,440 KB |
testcase_10 | AC | 23 ms
21,432 KB |
testcase_11 | AC | 25 ms
21,248 KB |
testcase_12 | AC | 25 ms
25,472 KB |
testcase_13 | AC | 25 ms
25,724 KB |
testcase_14 | AC | 26 ms
23,688 KB |
testcase_15 | AC | 23 ms
23,600 KB |
testcase_16 | AC | 24 ms
25,356 KB |
testcase_17 | AC | 23 ms
21,252 KB |
testcase_18 | AC | 24 ms
23,404 KB |
testcase_19 | AC | 24 ms
25,416 KB |
testcase_20 | AC | 23 ms
23,912 KB |
testcase_21 | AC | 23 ms
25,796 KB |
testcase_22 | AC | 25 ms
25,608 KB |
testcase_23 | AC | 25 ms
23,556 KB |
testcase_24 | AC | 35 ms
28,364 KB |
testcase_25 | AC | 28 ms
24,176 KB |
testcase_26 | AC | 24 ms
23,548 KB |
testcase_27 | AC | 32 ms
25,516 KB |
testcase_28 | AC | 24 ms
21,404 KB |
testcase_29 | AC | 24 ms
23,548 KB |
testcase_30 | AC | 24 ms
25,572 KB |
testcase_31 | AC | 24 ms
25,600 KB |
testcase_32 | AC | 25 ms
23,696 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var s = ReadLine(); var ans = 0; var tmp = 0; for (var i = 0; i < s.Length; ++i) { if (IsYuki(i, s)) { ++tmp; i += yuki.Length - 1; } else tmp = 0; ans = Math.Max(ans, tmp); } WriteLine(ans); } static string yuki = "yukicoder"; static bool IsYuki(int pos, string s) { if (pos + yuki.Length > s.Length) return false; for (var i = 0; i < yuki.Length; ++i) { if (yuki[i] != s[pos + i]) return false; } return true; } }