結果
| 問題 |
No.349 干支の置き物
|
| コンテスト | |
| ユーザー |
savior0222
|
| 提出日時 | 2016-04-03 16:51:10 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 607 bytes |
| コンパイル時間 | 908 ms |
| コンパイル使用メモリ | 105,344 KB |
| 実行使用メモリ | 18,688 KB |
| 最終ジャッジ日時 | 2024-11-17 07:30:03 |
| 合計ジャッジ時間 | 2,650 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / 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.Linq;
using System.Collections.Generic;
namespace program{
class program{
static void Main(string[] args){
var eto = new string[12] {"ne","ushi","tra","u","tatsu","mi","uma","hitsuji","saru","tori","inu","i"};
var cnt = new int[12];
int n = int.Parse(Console.ReadLine());
for( int i = 0; i < n; i++){
string str = Console.ReadLine();
for( int j = 0; j < 12; j++){
if( eto[j] == str ){
cnt[j]++;
}
}
}
if( cnt.Max() <= (n+1) / 2 ){
Console.WriteLine("YES");
}
else{
Console.WriteLine("NO");
}
}
}
}
savior0222