結果
問題 | No.349 干支の置き物 |
ユーザー |
![]() |
提出日時 | 2019-04-06 10:20:29 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 446 bytes |
コンパイル時間 | 940 ms |
コンパイル使用メモリ | 111,104 KB |
実行使用メモリ | 27,140 KB |
最終ジャッジ日時 | 2024-06-23 16:20:06 |
合計ジャッジ時間 | 2,972 ms |
ジャッジサーバーID (参考情報) |
judge3 / 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.Collections.Generic;using System.Linq;class Program {static void Main() {var n = int.Parse(Console.ReadLine());var s = "";var d = new Dictionary<string, int>();while ((s = Console.ReadLine()) != null) {if (d.ContainsKey(s)) d[s]++;else d[s] = 1;}if (d.Values.Max() > (n + 1) / 2) {Console.WriteLine("NO");} else {Console.WriteLine("YES");}}}