結果

問題 No.349 干支の置き物
ユーザー fal_rndfal_rnd
提出日時 2016-10-28 16:56:07
言語 Java19
(openjdk 21)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 768 bytes
コンパイル時間 2,449 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 58,172 KB
最終ジャッジ日時 2023-08-15 20:38:40
合計ジャッジ時間 8,135 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
55,872 KB
testcase_01 AC 133 ms
55,952 KB
testcase_02 AC 127 ms
55,720 KB
testcase_03 AC 132 ms
55,680 KB
testcase_04 AC 148 ms
55,576 KB
testcase_05 AC 145 ms
55,872 KB
testcase_06 AC 148 ms
55,752 KB
testcase_07 AC 135 ms
55,732 KB
testcase_08 AC 146 ms
55,776 KB
testcase_09 AC 142 ms
55,852 KB
testcase_10 AC 141 ms
55,476 KB
testcase_11 AC 149 ms
55,672 KB
testcase_12 AC 149 ms
53,912 KB
testcase_13 AC 151 ms
56,116 KB
testcase_14 AC 149 ms
56,124 KB
testcase_15 AC 146 ms
56,352 KB
testcase_16 AC 145 ms
58,172 KB
testcase_17 AC 132 ms
56,108 KB
testcase_18 AC 131 ms
55,852 KB
testcase_19 AC 132 ms
56,060 KB
testcase_20 AC 129 ms
55,712 KB
testcase_21 AC 128 ms
55,592 KB
testcase_22 AC 126 ms
55,828 KB
testcase_23 AC 124 ms
56,056 KB
testcase_24 AC 126 ms
56,288 KB
testcase_25 AC 128 ms
56,292 KB
testcase_26 AC 139 ms
56,168 KB
testcase_27 AC 153 ms
55,800 KB
testcase_28 AC 146 ms
56,260 KB
testcase_29 AC 162 ms
56,208 KB
testcase_30 AC 149 ms
55,912 KB
testcase_31 AC 161 ms
55,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class A {
	static Scanner s = new Scanner(System.in);
	static enum ETO{
		ne,
		ushi,
		tora,
		u,
		tatsu,
		mi,
		uma,
		hitsuji,
		saru,
		tori,
		inu,
		i,
		;

		int amount=0;

		static ETO match(String s) {
			boolean b = false;
			for(ETO eto:ETO.values()) {
				if(s.matches(eto.name())) {
					eto.amount++;
					return eto;
				}
			}
			return null;
		}
		@Override
		public String toString() {
			return this.name()+":"+this.amount;
		}
	}
	public static void main(String[] args) {
		int in = s.nextInt();
		while(s.hasNext()) {
			ETO.match(s.next());
		}
		int max = 0;
		for(ETO e:ETO.values()) {
			max = Math.max(max, e.amount);
		}
		if(max>in-max+1) {
			System.out.println("NO");
		}else {
			System.out.println("YES");
		}
	}
}
0