結果

問題 No.349 干支の置き物
ユーザー shinwisteriashinwisteria
提出日時 2017-04-02 21:48:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 686 bytes
コンパイル時間 3,897 ms
コンパイル使用メモリ 79,320 KB
実行使用メモリ 57,804 KB
最終ジャッジ日時 2023-09-22 07:47:45
合計ジャッジ時間 8,474 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,012 KB
testcase_01 AC 121 ms
55,812 KB
testcase_02 AC 120 ms
55,744 KB
testcase_03 AC 121 ms
55,996 KB
testcase_04 AC 127 ms
55,816 KB
testcase_05 AC 125 ms
55,992 KB
testcase_06 AC 126 ms
55,832 KB
testcase_07 AC 124 ms
56,008 KB
testcase_08 AC 125 ms
55,932 KB
testcase_09 AC 126 ms
55,836 KB
testcase_10 AC 127 ms
55,528 KB
testcase_11 AC 126 ms
56,136 KB
testcase_12 AC 129 ms
56,084 KB
testcase_13 AC 128 ms
55,896 KB
testcase_14 AC 122 ms
55,880 KB
testcase_15 AC 123 ms
56,136 KB
testcase_16 AC 124 ms
56,016 KB
testcase_17 AC 126 ms
55,864 KB
testcase_18 WA -
testcase_19 AC 123 ms
55,612 KB
testcase_20 WA -
testcase_21 AC 124 ms
55,792 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 123 ms
56,128 KB
testcase_26 AC 125 ms
56,144 KB
testcase_27 AC 126 ms
55,892 KB
testcase_28 AC 125 ms
55,888 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 129 ms
57,804 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