結果

問題 No.2298 yukicounter
ユーザー YGBKYGBK
提出日時 2023-05-15 19:30:05
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 623 bytes
コンパイル時間 5,276 ms
コンパイル使用メモリ 73,112 KB
実行使用メモリ 64,068 KB
最終ジャッジ日時 2023-08-20 19:48:16
合計ジャッジ時間 14,995 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
60,260 KB
testcase_01 AC 121 ms
55,792 KB
testcase_02 AC 121 ms
55,700 KB
testcase_03 AC 336 ms
64,068 KB
testcase_04 AC 243 ms
59,024 KB
testcase_05 AC 191 ms
56,320 KB
testcase_06 AC 346 ms
63,996 KB
testcase_07 AC 239 ms
59,316 KB
testcase_08 AC 192 ms
56,620 KB
testcase_09 AC 211 ms
57,284 KB
testcase_10 AC 176 ms
55,924 KB
testcase_11 AC 232 ms
59,708 KB
testcase_12 AC 229 ms
59,244 KB
testcase_13 AC 231 ms
59,196 KB
testcase_14 AC 241 ms
59,348 KB
testcase_15 AC 136 ms
56,076 KB
testcase_16 AC 196 ms
56,280 KB
testcase_17 AC 187 ms
56,844 KB
testcase_18 AC 122 ms
57,808 KB
testcase_19 AC 127 ms
55,492 KB
testcase_20 AC 122 ms
53,684 KB
testcase_21 AC 121 ms
55,492 KB
testcase_22 TLE -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class MyMain {

	final static String YUKICODER = "yukicoder";

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();

		int max = 0;
		int i = 1;
		while (true) {
			final String str = generateStr(i);

			int index = s.indexOf(str);

			if (index == -1) {
				break;
			} else {
				max = i;
			}
			i++;
		}

		System.out.println(max);

		sc.close();
	}

	public static String generateStr(int n) {
		StringBuilder sb = new StringBuilder();

		for (int i = 0; i < n; i++) {
			sb.append(YUKICODER);
		}
		return sb.toString();
	}

}
0