結果

問題 No.349 干支の置き物
ユーザー shinwisteriashinwisteria
提出日時 2017-04-02 21:44:25
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 654 bytes
コンパイル時間 5,277 ms
コンパイル使用メモリ 79,296 KB
実行使用メモリ 57,684 KB
最終ジャッジ日時 2023-09-22 07:47:03
合計ジャッジ時間 9,078 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
55,636 KB
testcase_01 AC 131 ms
55,508 KB
testcase_02 AC 131 ms
55,692 KB
testcase_03 AC 132 ms
55,700 KB
testcase_04 AC 133 ms
55,888 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 132 ms
55,388 KB
testcase_08 RE -
testcase_09 AC 129 ms
55,904 KB
testcase_10 AC 131 ms
55,584 KB
testcase_11 AC 131 ms
55,696 KB
testcase_12 RE -
testcase_13 AC 131 ms
55,632 KB
testcase_14 AC 129 ms
55,912 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 130 ms
55,640 KB
testcase_18 WA -
testcase_19 AC 128 ms
55,904 KB
testcase_20 WA -
testcase_21 AC 128 ms
55,752 KB
testcase_22 AC 128 ms
55,748 KB
testcase_23 WA -
testcase_24 AC 129 ms
55,380 KB
testcase_25 AC 128 ms
55,920 KB
testcase_26 AC 130 ms
55,668 KB
testcase_27 RE -
testcase_28 AC 132 ms
55,700 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 132 ms
55,776 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.nextLine();
			if(list.contains(str)){
				eto[list.indexOf(str)]++;
			}else{
				list.add(str);
				eto[list.size()-1]++;
			}
		}
		s.close();
		Arrays.sort(eto);
		if(N-eto[11] >= eto[11] + 1){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}

	}

}
0