結果

問題 No.349 干支の置き物
ユーザー yun_appyun_app
提出日時 2016-05-09 13:03:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 851 bytes
コンパイル時間 2,228 ms
コンパイル使用メモリ 75,644 KB
実行使用メモリ 37,056 KB
最終ジャッジ日時 2024-04-28 14:48:14
合計ジャッジ時間 4,826 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
36,852 KB
testcase_01 AC 51 ms
36,992 KB
testcase_02 AC 53 ms
36,628 KB
testcase_03 AC 52 ms
36,792 KB
testcase_04 AC 52 ms
36,320 KB
testcase_05 AC 52 ms
36,660 KB
testcase_06 AC 52 ms
36,288 KB
testcase_07 AC 53 ms
36,556 KB
testcase_08 AC 53 ms
36,628 KB
testcase_09 AC 53 ms
36,816 KB
testcase_10 AC 52 ms
36,556 KB
testcase_11 AC 54 ms
36,856 KB
testcase_12 AC 52 ms
36,316 KB
testcase_13 AC 54 ms
36,556 KB
testcase_14 AC 55 ms
36,644 KB
testcase_15 AC 52 ms
36,948 KB
testcase_16 AC 53 ms
36,548 KB
testcase_17 AC 53 ms
36,904 KB
testcase_18 AC 53 ms
36,632 KB
testcase_19 AC 51 ms
36,804 KB
testcase_20 AC 51 ms
36,984 KB
testcase_21 AC 52 ms
36,672 KB
testcase_22 AC 52 ms
36,648 KB
testcase_23 AC 52 ms
36,844 KB
testcase_24 AC 52 ms
36,532 KB
testcase_25 AC 51 ms
36,548 KB
testcase_26 AC 51 ms
37,056 KB
testcase_27 AC 51 ms
36,648 KB
testcase_28 AC 52 ms
36,316 KB
testcase_29 AC 52 ms
36,644 KB
testcase_30 AC 52 ms
36,884 KB
testcase_31 AC 50 ms
36,680 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