結果

問題 No.1367 文字列門松
ユーザー tentententen
提出日時 2021-02-02 10:29:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 3,974 ms
コンパイル使用メモリ 71,564 KB
実行使用メモリ 56,312 KB
最終ジャッジ日時 2023-09-12 11:01:33
合計ジャッジ時間 7,466 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,888 KB
testcase_01 AC 120 ms
56,128 KB
testcase_02 AC 117 ms
55,724 KB
testcase_03 AC 119 ms
55,740 KB
testcase_04 AC 117 ms
56,012 KB
testcase_05 AC 118 ms
55,752 KB
testcase_06 AC 119 ms
55,756 KB
testcase_07 AC 118 ms
55,784 KB
testcase_08 AC 119 ms
55,992 KB
testcase_09 AC 119 ms
55,616 KB
testcase_10 AC 119 ms
55,712 KB
testcase_11 AC 120 ms
55,532 KB
testcase_12 AC 118 ms
56,248 KB
testcase_13 AC 119 ms
56,164 KB
testcase_14 AC 117 ms
55,752 KB
testcase_15 AC 118 ms
55,908 KB
testcase_16 AC 118 ms
55,684 KB
testcase_17 AC 121 ms
56,120 KB
testcase_18 AC 117 ms
55,780 KB
testcase_19 AC 117 ms
56,312 KB
testcase_20 AC 116 ms
54,232 KB
testcase_21 AC 118 ms
55,988 KB
testcase_22 AC 118 ms
55,580 KB
testcase_23 AC 119 ms
55,836 KB
testcase_24 AC 118 ms
55,764 KB
testcase_25 AC 118 ms
55,660 KB
testcase_26 AC 119 ms
55,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] org = "kadomatsu".toCharArray();
        char[] arr = sc.next().toCharArray();
        int idx = 0;
        for (int i = 0; i < org.length && idx < arr.length; i++) {
            if (org[i] == arr[idx]) {
                idx++;
            }
        }
        if (idx < arr.length) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
}
0