結果

問題 No.3020 サンシャイン◯崎
ユーザー yagi2yagi2
提出日時 2017-04-25 18:13:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 392 ms / 1,000 ms
コード長 773 bytes
コンパイル時間 2,177 ms
コンパイル使用メモリ 74,468 KB
実行使用メモリ 66,016 KB
最終ジャッジ日時 2023-08-25 02:04:37
合計ジャッジ時間 8,732 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,696 KB
testcase_01 AC 123 ms
55,696 KB
testcase_02 AC 128 ms
55,684 KB
testcase_03 AC 123 ms
55,720 KB
testcase_04 AC 126 ms
55,408 KB
testcase_05 AC 378 ms
65,872 KB
testcase_06 AC 127 ms
55,536 KB
testcase_07 AC 126 ms
55,680 KB
testcase_08 AC 285 ms
62,620 KB
testcase_09 AC 291 ms
62,968 KB
testcase_10 AC 372 ms
65,624 KB
testcase_11 AC 359 ms
65,668 KB
testcase_12 AC 383 ms
66,016 KB
testcase_13 AC 392 ms
65,400 KB
testcase_14 AC 378 ms
65,456 KB
testcase_15 AC 370 ms
65,700 KB
testcase_16 AC 362 ms
65,812 KB
testcase_17 AC 381 ms
65,856 KB
testcase_18 AC 379 ms
65,772 KB
testcase_19 AC 379 ms
65,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String[] S = sc.next().split("");

        Map<String, Integer> YEAH = new HashMap<>();
        for (String s : S) {
            if (!YEAH.containsKey(s)) YEAH.put(s, 0);
            YEAH.put(s, YEAH.get(s) + 1);
        }

        System.out.printf("%d %d %d %d %d\n",
                (YEAH.containsKey("Y"))? YEAH.get("Y") : 0,
                (YEAH.containsKey("E"))? YEAH.get("E") : 0,
                (YEAH.containsKey("A"))? YEAH.get("A") : 0,
                (YEAH.containsKey("H"))? YEAH.get("H") : 0,
                (YEAH.containsKey("!"))? YEAH.get("!") : 0);
    }
}
0