結果

問題 No.349 干支の置き物
ユーザー huffman56
提出日時 2022-11-05 09:41:43
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 839 bytes
コンパイル時間 2,271 ms
コンパイル使用メモリ 105,984 KB
実行使用メモリ 18,944 KB
最終ジャッジ日時 2024-07-19 04:54:15
合計ジャッジ時間 4,150 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using static System.Math;

namespace SortItems
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var d = new Dictionary<string, int>();

            for (var i = 0; i < n; i++)
            {
                var s = Console.ReadLine();
                if (d.ContainsKey(s))
                {
                    d[s]++;
                }
                else
                {
                    d[s] = 1;
                }
            }

            if (d.Values.Max() < (n / 2) + 1)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }

        }
    }
}
0