結果
| 問題 | 
                            No.349 干支の置き物
                             | 
                    
| コンテスト | |
| ユーザー | 
                             mban
                         | 
                    
| 提出日時 | 2016-11-04 13:58:32 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 26 ms / 2,000 ms | 
| コード長 | 894 bytes | 
| コンパイル時間 | 1,586 ms | 
| コンパイル使用メモリ | 112,648 KB | 
| 実行使用メモリ | 26,888 KB | 
| 最終ジャッジ日時 | 2024-11-25 02:53:27 | 
| 合計ジャッジ時間 | 2,805 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 29 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Magatro
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        Dictionary<string, int> D = new Dictionary<string, int>();
        D.Add("ne", 0);
        D.Add("ushi", 1);
        D.Add("tora", 2);
        D.Add("u", 3);
        D.Add("tatsu", 4);
        D.Add("mi", 5);
        D.Add("uma", 6);
        D.Add("hitsuji", 7);
        D.Add("saru", 8);
        D.Add("tori", 9);
        D.Add("inu", 10);
        D.Add("i", 11);
        int[] cnt = new int[12];
        int I = N - N / 2;
for(int i = 0; i < N; i++)
        {
            cnt[D[Console.ReadLine()]]++;
        }
        if (I < cnt.Max())
        {
            Console.WriteLine("NO");
        }
        else
        {
            Console.WriteLine("YES");
        }
    }
}
            
            
            
        
            
mban