結果

問題 No.349 干支の置き物
ユーザー qwrtpsfgqwrtpsfg
提出日時 2017-08-25 21:06:46
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 892 bytes
コンパイル時間 786 ms
コンパイル使用メモリ 110,548 KB
実行使用メモリ 26,804 KB
最終ジャッジ日時 2024-04-23 15:22:29
合計ジャッジ時間 2,537 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
26,516 KB
testcase_01 AC 24 ms
24,528 KB
testcase_02 AC 27 ms
26,520 KB
testcase_03 AC 25 ms
24,620 KB
testcase_04 AC 26 ms
24,788 KB
testcase_05 AC 25 ms
24,496 KB
testcase_06 AC 25 ms
26,660 KB
testcase_07 AC 25 ms
24,400 KB
testcase_08 AC 25 ms
24,748 KB
testcase_09 AC 26 ms
26,780 KB
testcase_10 AC 26 ms
26,664 KB
testcase_11 AC 26 ms
24,612 KB
testcase_12 AC 25 ms
24,736 KB
testcase_13 AC 26 ms
24,620 KB
testcase_14 AC 26 ms
22,580 KB
testcase_15 AC 25 ms
24,524 KB
testcase_16 AC 25 ms
24,604 KB
testcase_17 AC 25 ms
24,660 KB
testcase_18 AC 26 ms
24,872 KB
testcase_19 AC 26 ms
24,652 KB
testcase_20 AC 25 ms
24,528 KB
testcase_21 AC 25 ms
24,600 KB
testcase_22 AC 25 ms
24,528 KB
testcase_23 AC 25 ms
24,500 KB
testcase_24 AC 25 ms
24,400 KB
testcase_25 AC 25 ms
22,456 KB
testcase_26 AC 26 ms
24,476 KB
testcase_27 AC 26 ms
24,600 KB
testcase_28 AC 27 ms
24,400 KB
testcase_29 AC 26 ms
26,804 KB
testcase_30 AC 25 ms
24,528 KB
testcase_31 AC 27 ms
24,912 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;

public class yukicoder
{
    public static void Main()
    {
		int n = int.Parse(Console.ReadLine());
		int[] eto = new int[12];
		string s = "";
		string ans = "YES";

		for(int i = 0; i <= n - 1; i++)
		{
			s = Console.ReadLine();
			
			if(s == "ne") eto[0] ++;
			else if(s == "ushi") eto[1] ++;
			else if(s == "tora") eto[2] ++;
			else if(s == "u") eto[3] ++;
			else if(s == "tatsu") eto[4] ++;
			else if(s == "mi") eto[5] ++;
			else if(s == "uma") eto[6] ++;
			else if(s == "hitsuji") eto[7] ++;
			else if(s == "saru") eto[8] ++;
			else if(s == "tori") eto[9] ++;
			else if(s == "inu") eto[10] ++;
			else if(s == "i") eto[11] ++;
		}
		
		if(n % 2 == 0 && eto.Max() > n / 2)
		{
			ans = "NO";
		}
		else if(n % 2 != 0 && eto.Max() > (n / 2) + 1)
		{
			ans = "NO";
		}

		Console.WriteLine(ans);

    }
}

0