結果

問題 No.349 干支の置き物
ユーザー huffman56huffman56
提出日時 2022-11-05 09:57:24
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 838 bytes
コンパイル時間 3,421 ms
コンパイル使用メモリ 105,100 KB
実行使用メモリ 23,508 KB
最終ジャッジ日時 2023-09-26 10:12:30
合計ジャッジ時間 7,036 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,392 KB
testcase_01 AC 61 ms
23,508 KB
testcase_02 AC 63 ms
23,432 KB
testcase_03 AC 61 ms
23,408 KB
testcase_04 AC 60 ms
21,296 KB
testcase_05 AC 61 ms
21,344 KB
testcase_06 AC 60 ms
21,372 KB
testcase_07 AC 60 ms
21,288 KB
testcase_08 AC 61 ms
23,472 KB
testcase_09 AC 60 ms
23,392 KB
testcase_10 AC 61 ms
21,340 KB
testcase_11 AC 62 ms
23,400 KB
testcase_12 AC 64 ms
23,428 KB
testcase_13 AC 62 ms
23,436 KB
testcase_14 AC 61 ms
23,392 KB
testcase_15 AC 61 ms
21,392 KB
testcase_16 AC 63 ms
23,396 KB
testcase_17 AC 60 ms
21,380 KB
testcase_18 AC 60 ms
21,352 KB
testcase_19 AC 61 ms
23,408 KB
testcase_20 AC 59 ms
21,476 KB
testcase_21 AC 61 ms
21,376 KB
testcase_22 AC 59 ms
21,344 KB
testcase_23 AC 60 ms
21,332 KB
testcase_24 AC 59 ms
21,392 KB
testcase_25 AC 60 ms
23,340 KB
testcase_26 AC 60 ms
21,368 KB
testcase_27 AC 61 ms
21,392 KB
testcase_28 AC 58 ms
19,292 KB
testcase_29 AC 60 ms
21,400 KB
testcase_30 AC 59 ms
21,372 KB
testcase_31 AC 61 ms
21,448 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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+1)/2+ 1)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }

        }
    }
}
0