結果

問題 No.1367 文字列門松
ユーザー ks2mks2m
提出日時 2021-01-29 21:36:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 473 bytes
コンパイル時間 3,878 ms
コンパイル使用メモリ 72,072 KB
実行使用メモリ 56,348 KB
最終ジャッジ日時 2023-09-09 14:53:36
合計ジャッジ時間 6,178 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
55,744 KB
testcase_01 AC 113 ms
56,124 KB
testcase_02 AC 114 ms
55,720 KB
testcase_03 AC 112 ms
55,796 KB
testcase_04 AC 114 ms
55,860 KB
testcase_05 AC 114 ms
55,904 KB
testcase_06 AC 113 ms
56,120 KB
testcase_07 AC 113 ms
54,060 KB
testcase_08 AC 113 ms
55,764 KB
testcase_09 AC 112 ms
55,448 KB
testcase_10 AC 110 ms
56,348 KB
testcase_11 AC 110 ms
55,416 KB
testcase_12 AC 115 ms
55,516 KB
testcase_13 AC 111 ms
56,116 KB
testcase_14 AC 114 ms
56,120 KB
testcase_15 AC 113 ms
55,528 KB
testcase_16 AC 115 ms
56,252 KB
testcase_17 AC 114 ms
55,640 KB
testcase_18 AC 112 ms
55,760 KB
testcase_19 AC 116 ms
55,772 KB
testcase_20 AC 114 ms
55,644 KB
testcase_21 AC 114 ms
55,928 KB
testcase_22 AC 114 ms
54,004 KB
testcase_23 AC 113 ms
55,372 KB
testcase_24 AC 114 ms
56,180 KB
testcase_25 AC 111 ms
55,980 KB
testcase_26 AC 113 ms
55,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();

		char[] t = "kadomatsu".toCharArray();
		int j = 0;
		for (int i = 0; i < t.length; i++) {
			if (j == s.length) {
				break;
			}
			if (s[j] == t[i]) {
				j++;
			}
		}
		if (j == s.length) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}
0