結果

問題 No.349 干支の置き物
ユーザー yun_appyun_app
提出日時 2016-05-09 13:03:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 851 bytes
コンパイル時間 2,011 ms
コンパイル使用メモリ 72,048 KB
実行使用メモリ 49,636 KB
最終ジャッジ日時 2023-08-10 21:44:28
合計ジャッジ時間 4,495 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
48,940 KB
testcase_01 AC 40 ms
49,252 KB
testcase_02 AC 42 ms
49,236 KB
testcase_03 AC 42 ms
49,388 KB
testcase_04 AC 41 ms
48,932 KB
testcase_05 AC 40 ms
48,892 KB
testcase_06 AC 40 ms
48,988 KB
testcase_07 AC 41 ms
49,200 KB
testcase_08 AC 41 ms
49,216 KB
testcase_09 AC 41 ms
49,240 KB
testcase_10 AC 42 ms
49,416 KB
testcase_11 AC 42 ms
49,228 KB
testcase_12 AC 42 ms
49,168 KB
testcase_13 AC 41 ms
47,136 KB
testcase_14 AC 40 ms
49,144 KB
testcase_15 AC 43 ms
48,992 KB
testcase_16 AC 41 ms
48,924 KB
testcase_17 AC 43 ms
49,208 KB
testcase_18 AC 40 ms
49,120 KB
testcase_19 AC 40 ms
49,128 KB
testcase_20 AC 43 ms
49,204 KB
testcase_21 AC 40 ms
49,204 KB
testcase_22 AC 39 ms
49,476 KB
testcase_23 AC 41 ms
49,124 KB
testcase_24 AC 40 ms
49,184 KB
testcase_25 AC 43 ms
49,420 KB
testcase_26 AC 41 ms
49,432 KB
testcase_27 AC 42 ms
49,636 KB
testcase_28 AC 40 ms
49,336 KB
testcase_29 AC 42 ms
49,100 KB
testcase_30 AC 42 ms
49,120 KB
testcase_31 AC 40 ms
49,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        HashMap<String,Integer> map = new HashMap<String,Integer>();
        for(int i=0;i<n;i++){
            String key = br.readLine();
            map.put(key,map.containsKey(key)?map.get(key)+1:1);
        }
        int max = 0;
        for(String key:map.keySet()){
            max = Math.max(max,map.get(key));
        }
        String ans = (n+1)/2>=max?"YES":"NO";
        System.out.println(ans);
    }
}
0