結果
問題 | No.349 干支の置き物 |
ユーザー |
|
提出日時 | 2017-08-25 20:56:56 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 910 bytes |
コンパイル時間 | 788 ms |
コンパイル使用メモリ | 110,420 KB |
実行使用メモリ | 26,908 KB |
最終ジャッジ日時 | 2024-10-15 15:43:50 |
合計ジャッジ時間 | 2,560 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 4 |
コンパイルメッセージ
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; 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(eto.Max() % 2 == 0 && eto.Max() >= n / 2) { ans = "NO"; } else if(eto.Max() % 2 != 0 && eto.Max() >= (n / 2) + 1) { ans = "NO"; } Console.WriteLine(ans); } }