結果

問題 No.349 干支の置き物
ユーザー AoiroFukurouAoiroFukurou
提出日時 2016-05-14 15:05:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 1,051 bytes
コンパイル時間 4,909 ms
コンパイル使用メモリ 74,248 KB
実行使用メモリ 56,512 KB
最終ジャッジ日時 2023-08-10 21:45:23
合計ジャッジ時間 8,337 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
56,136 KB
testcase_01 AC 117 ms
56,216 KB
testcase_02 AC 119 ms
55,988 KB
testcase_03 AC 120 ms
55,860 KB
testcase_04 AC 125 ms
56,008 KB
testcase_05 AC 122 ms
55,504 KB
testcase_06 AC 126 ms
55,480 KB
testcase_07 AC 121 ms
55,728 KB
testcase_08 AC 121 ms
55,516 KB
testcase_09 AC 120 ms
55,280 KB
testcase_10 AC 122 ms
55,656 KB
testcase_11 AC 127 ms
55,420 KB
testcase_12 AC 123 ms
55,708 KB
testcase_13 AC 123 ms
55,812 KB
testcase_14 AC 119 ms
55,552 KB
testcase_15 AC 113 ms
55,548 KB
testcase_16 AC 116 ms
55,752 KB
testcase_17 AC 119 ms
56,512 KB
testcase_18 AC 117 ms
56,320 KB
testcase_19 AC 118 ms
56,072 KB
testcase_20 AC 118 ms
56,256 KB
testcase_21 AC 121 ms
56,176 KB
testcase_22 AC 113 ms
55,672 KB
testcase_23 AC 115 ms
55,952 KB
testcase_24 AC 119 ms
55,940 KB
testcase_25 AC 118 ms
55,588 KB
testcase_26 AC 120 ms
55,472 KB
testcase_27 AC 124 ms
55,960 KB
testcase_28 AC 123 ms
55,384 KB
testcase_29 AC 120 ms
56,064 KB
testcase_30 AC 120 ms
55,680 KB
testcase_31 AC 122 ms
55,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class No349 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.nextLine();
		String[] s = new String[N];
		int[] eto = new int[12];
		for (int i = 0; i < s.length; i++) {
			s[i] = sc.nextLine();
			switch (s[i]) {
			case "ne":
				eto[0]++;
				break;
			case "ushi":
				eto[1]++;
				break;
			case "tora":
				eto[2]++;
				break;
			case "u":
				eto[3]++;
				break;
			case "tatsu":
				eto[4]++;
				break;
			case "mi":
				eto[5]++;
				break;
			case "uma":
				eto[6]++;
				break;
			case "hitsuji":
				eto[7]++;
				break;
			case "saru":
				eto[8]++;
				break;
			case "tori":
				eto[9]++;
				break;
			case "inu":
				eto[10]++;
				break;
			case "i":
				eto[11]++;
				break;
			}
		}
		boolean b = false;
		for (int i = 0; i < 12; i++) {
			int t = N;
			t -= eto[i];
			if (!(eto[i] - 1 <= t)) {
				b = true;
			}
		}
		if (b) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}
}
0