結果
| 問題 |
No.349 干支の置き物
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-20 01:14:32 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 23 ms / 2,000 ms |
| コード長 | 831 bytes |
| コンパイル時間 | 2,866 ms |
| コンパイル使用メモリ | 103,552 KB |
| 実行使用メモリ | 17,792 KB |
| 最終ジャッジ日時 | 2024-11-17 07:28:22 |
| 合計ジャッジ時間 | 4,124 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
public class Program {
public static void Main() {
string[] eto = {"ne", "ushi", "tora", "u", "tatsu", "mi", "uma", "hitsuji", "saru", "tori", "inu", "i"};
int n = int.Parse(Console.ReadLine());
int[] count = new int[12];
for (int i = 0; i < 12; i++) {
count[i] = 0;
}
for (int i = 0; i < n; i++) {
string current = Console.ReadLine();
for (int j = 0; j < 12; j++) {
if (current == eto[j]) {
count[j]++;
break;
}
}
}
for (int i = 0; i < 12; i++) {
if (count[i] > Math.Ceiling(n/2.0)) {
Console.WriteLine("NO");
return;
}
}
Console.WriteLine("YES");
}
}