結果
問題 | No.349 干支の置き物 |
ユーザー |
|
提出日時 | 2017-02-27 14:11:06 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 870 bytes |
コンパイル時間 | 2,556 ms |
コンパイル使用メモリ | 105,088 KB |
実行使用メモリ | 19,072 KB |
最終ジャッジ日時 | 2024-06-11 19:23:05 |
合計ジャッジ時間 | 2,784 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.Linq; using System.Collections.Generic; class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int[] a = new int[12]; 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); for (int i = 0; i < n; i++) { a[d[Console.ReadLine()]]++; } if ((n - n / 2) < a.Max()) { Console.WriteLine("NO"); } else { Console.WriteLine("YES"); } Console.Read(); } }