結果

問題 No.349 干支の置き物
ユーザー TatsuDXTatsuDX
提出日時 2016-09-03 14:49:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 630 bytes
コンパイル時間 3,674 ms
コンパイル使用メモリ 74,872 KB
実行使用メモリ 41,512 KB
最終ジャッジ日時 2024-04-28 14:54:07
合計ジャッジ時間 7,541 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
41,104 KB
testcase_01 AC 113 ms
41,260 KB
testcase_02 AC 120 ms
41,396 KB
testcase_03 AC 109 ms
41,140 KB
testcase_04 AC 119 ms
41,144 KB
testcase_05 AC 120 ms
40,004 KB
testcase_06 AC 119 ms
41,276 KB
testcase_07 AC 114 ms
40,488 KB
testcase_08 AC 105 ms
40,176 KB
testcase_09 AC 116 ms
41,404 KB
testcase_10 AC 110 ms
39,860 KB
testcase_11 AC 114 ms
40,380 KB
testcase_12 AC 113 ms
40,268 KB
testcase_13 AC 112 ms
41,512 KB
testcase_14 AC 120 ms
41,148 KB
testcase_15 AC 118 ms
40,972 KB
testcase_16 AC 113 ms
40,848 KB
testcase_17 AC 115 ms
41,120 KB
testcase_18 AC 114 ms
40,824 KB
testcase_19 AC 97 ms
39,592 KB
testcase_20 AC 110 ms
41,084 KB
testcase_21 AC 107 ms
41,036 KB
testcase_22 AC 120 ms
41,188 KB
testcase_23 AC 104 ms
40,100 KB
testcase_24 AC 111 ms
41,136 KB
testcase_25 AC 111 ms
40,400 KB
testcase_26 AC 119 ms
40,720 KB
testcase_27 AC 124 ms
41,012 KB
testcase_28 AC 115 ms
41,036 KB
testcase_29 AC 114 ms
41,380 KB
testcase_30 AC 112 ms
41,232 KB
testcase_31 AC 113 ms
40,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String[] str = { "ne", "ushi", "tora", "u", "tatsu", "mi", "uma", "hitsuji", "saru", "tori", "inu", "i" };
		int[] t = new int[12];
		int n = sc.nextInt(), max = 0;
		String s;
		for (int i = 0; i < n; i++) {
			s = sc.next();
			for (int j = 0; j < 12; j++) {
				if (s.equals(str[j])) {
					t[j]++;
					break;
				}
			}
		}
		for (int j = 0; j < 12; j++) {
			max = Math.max(max, t[j]);
		}
		if (n < max * 2 - 1) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}
}
0