結果

問題 No.349 干支の置き物
ユーザー tsunabittsunabit
提出日時 2019-05-28 00:00:13
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 869 bytes
コンパイル時間 3,738 ms
コンパイル使用メモリ 85,220 KB
実行使用メモリ 57,772 KB
最終ジャッジ日時 2023-10-17 18:20:36
合計ジャッジ時間 9,468 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
57,412 KB
testcase_01 AC 132 ms
57,420 KB
testcase_02 AC 132 ms
57,568 KB
testcase_03 AC 134 ms
57,704 KB
testcase_04 AC 140 ms
57,364 KB
testcase_05 AC 136 ms
57,656 KB
testcase_06 AC 138 ms
57,644 KB
testcase_07 AC 133 ms
57,600 KB
testcase_08 AC 137 ms
57,560 KB
testcase_09 AC 137 ms
57,412 KB
testcase_10 AC 123 ms
56,152 KB
testcase_11 AC 138 ms
57,364 KB
testcase_12 AC 140 ms
57,324 KB
testcase_13 AC 139 ms
57,504 KB
testcase_14 AC 136 ms
57,344 KB
testcase_15 AC 136 ms
57,644 KB
testcase_16 AC 136 ms
57,464 KB
testcase_17 AC 133 ms
57,392 KB
testcase_18 AC 130 ms
57,368 KB
testcase_19 AC 134 ms
57,476 KB
testcase_20 AC 136 ms
57,408 KB
testcase_21 AC 135 ms
57,420 KB
testcase_22 WA -
testcase_23 AC 134 ms
57,396 KB
testcase_24 WA -
testcase_25 AC 134 ms
57,512 KB
testcase_26 AC 140 ms
57,424 KB
testcase_27 AC 142 ms
57,408 KB
testcase_28 AC 136 ms
57,448 KB
testcase_29 WA -
testcase_30 AC 137 ms
57,352 KB
testcase_31 AC 143 ms
57,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class No349 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner s = new Scanner(System.in);
        Map<String, Integer> eto = new HashMap<String, Integer>() {{ put("ne", 0); put("ushi", 0); put("tora", 0); put("u", 0); put("tatsu", 0); put("mi", 0); put("uma", 0); put("hitsuji", 0); put("saru", 0); put("tori", 0); put("inu", 0); put("i", 0);}};
        int n = s.nextInt();
        for(int i = 0; i < n; i++) {
        	String temp = s.next();
        	eto.put(temp, eto.get(temp) + 1);
        }
        int max = 0;
        for(int c : eto.values()) {
        	max = max < c? c : max;
        }
        if(max > (n / 2)) {
        	System.out.println("NO");
        }else {
        	System.out.println("YES");
        }
        
    }
}
0