結果

問題 No.349 干支の置き物
ユーザー shinwisteria
提出日時 2017-04-02 21:44:25
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 654 bytes
コンパイル時間 3,600 ms
コンパイル使用メモリ 75,664 KB
実行使用メモリ 54,448 KB
最終ジャッジ日時 2024-07-08 00:16:01
合計ジャッジ時間 8,964 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 5 RE * 7
権限があれば一括ダウンロードができます

ソースコード

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