結果

問題 No.349 干支の置き物
ユーザー TatsuDXTatsuDX
提出日時 2016-09-03 14:49:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 630 bytes
コンパイル時間 5,870 ms
コンパイル使用メモリ 72,496 KB
実行使用メモリ 57,808 KB
最終ジャッジ日時 2023-08-10 21:50:57
合計ジャッジ時間 9,057 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,660 KB
testcase_01 AC 124 ms
55,708 KB
testcase_02 AC 119 ms
55,576 KB
testcase_03 AC 115 ms
56,252 KB
testcase_04 AC 115 ms
55,928 KB
testcase_05 AC 117 ms
55,640 KB
testcase_06 AC 119 ms
55,556 KB
testcase_07 AC 116 ms
54,400 KB
testcase_08 AC 120 ms
55,976 KB
testcase_09 AC 120 ms
56,048 KB
testcase_10 AC 118 ms
56,040 KB
testcase_11 AC 122 ms
55,504 KB
testcase_12 AC 118 ms
55,508 KB
testcase_13 AC 115 ms
55,792 KB
testcase_14 AC 113 ms
56,588 KB
testcase_15 AC 113 ms
55,616 KB
testcase_16 AC 113 ms
55,840 KB
testcase_17 AC 116 ms
55,592 KB
testcase_18 AC 114 ms
55,692 KB
testcase_19 AC 114 ms
55,640 KB
testcase_20 AC 115 ms
55,668 KB
testcase_21 AC 111 ms
56,044 KB
testcase_22 AC 110 ms
55,640 KB
testcase_23 AC 123 ms
56,208 KB
testcase_24 AC 118 ms
57,808 KB
testcase_25 AC 115 ms
56,276 KB
testcase_26 AC 119 ms
55,576 KB
testcase_27 AC 124 ms
55,896 KB
testcase_28 AC 123 ms
55,480 KB
testcase_29 AC 119 ms
55,624 KB
testcase_30 AC 128 ms
55,952 KB
testcase_31 AC 123 ms
55,672 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