結果

問題 No.349 干支の置き物
ユーザー shinwisteriashinwisteria
提出日時 2017-04-02 21:53:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 685 bytes
コンパイル時間 3,284 ms
コンパイル使用メモリ 73,444 KB
実行使用メモリ 57,964 KB
最終ジャッジ日時 2023-09-22 07:48:16
合計ジャッジ時間 8,645 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,960 KB
testcase_01 AC 127 ms
55,840 KB
testcase_02 AC 126 ms
55,740 KB
testcase_03 AC 128 ms
55,896 KB
testcase_04 AC 128 ms
55,928 KB
testcase_05 AC 131 ms
56,140 KB
testcase_06 AC 131 ms
55,856 KB
testcase_07 AC 129 ms
55,736 KB
testcase_08 AC 131 ms
56,004 KB
testcase_09 AC 129 ms
55,816 KB
testcase_10 AC 124 ms
55,740 KB
testcase_11 AC 128 ms
55,828 KB
testcase_12 AC 130 ms
56,000 KB
testcase_13 AC 130 ms
56,068 KB
testcase_14 AC 129 ms
53,912 KB
testcase_15 AC 129 ms
56,744 KB
testcase_16 AC 128 ms
55,844 KB
testcase_17 AC 124 ms
55,884 KB
testcase_18 AC 126 ms
55,568 KB
testcase_19 AC 126 ms
55,804 KB
testcase_20 AC 123 ms
55,996 KB
testcase_21 AC 123 ms
57,964 KB
testcase_22 AC 122 ms
56,048 KB
testcase_23 AC 124 ms
55,836 KB
testcase_24 AC 125 ms
55,812 KB
testcase_25 AC 127 ms
55,896 KB
testcase_26 AC 130 ms
56,144 KB
testcase_27 AC 130 ms
54,476 KB
testcase_28 AC 130 ms
56,000 KB
testcase_29 AC 131 ms
55,656 KB
testcase_30 AC 128 ms
55,836 KB
testcase_31 AC 129 ms
55,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Eto {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		int[] eto = new int[12];
		ArrayList<String> list = new ArrayList<>();
		for(int i = 0;i < N;i++){
			String str = s.next();
			if(list.contains(str)){
				eto[list.indexOf(str)]++;
			}else{
				//System.out.println(list);
				list.add(str);
				eto[list.indexOf(str)]++;
			}
		}
		s.close();
		Arrays.sort(eto);
		if(N-eto[11] >= eto[11] -1){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}

	}

}
0