結果

問題 No.349 干支の置き物
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-09-13 01:09:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 2,205 ms
コンパイル使用メモリ 104,592 KB
実行使用メモリ 23,616 KB
最終ジャッジ日時 2023-09-10 19:06:36
合計ジャッジ時間 5,795 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
19,296 KB
testcase_01 AC 58 ms
21,480 KB
testcase_02 AC 57 ms
23,436 KB
testcase_03 AC 58 ms
21,536 KB
testcase_04 AC 57 ms
21,376 KB
testcase_05 AC 58 ms
23,616 KB
testcase_06 AC 58 ms
23,484 KB
testcase_07 AC 57 ms
19,428 KB
testcase_08 AC 58 ms
21,488 KB
testcase_09 AC 57 ms
21,576 KB
testcase_10 AC 58 ms
23,500 KB
testcase_11 AC 59 ms
21,532 KB
testcase_12 AC 58 ms
21,436 KB
testcase_13 AC 58 ms
23,468 KB
testcase_14 AC 57 ms
21,372 KB
testcase_15 AC 57 ms
21,364 KB
testcase_16 AC 58 ms
23,492 KB
testcase_17 AC 57 ms
23,460 KB
testcase_18 AC 55 ms
21,436 KB
testcase_19 AC 56 ms
21,584 KB
testcase_20 AC 57 ms
23,440 KB
testcase_21 AC 56 ms
21,448 KB
testcase_22 AC 57 ms
23,500 KB
testcase_23 AC 57 ms
23,532 KB
testcase_24 AC 57 ms
23,504 KB
testcase_25 AC 57 ms
21,468 KB
testcase_26 AC 59 ms
23,432 KB
testcase_27 AC 57 ms
21,436 KB
testcase_28 AC 56 ms
23,556 KB
testcase_29 AC 58 ms
23,512 KB
testcase_30 AC 56 ms
23,556 KB
testcase_31 AC 57 ms
21,476 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.Linq;
using System.Collections.Generic;

class No349
{
    static void Main()
    {
        var num = Int32.Parse(Console.ReadLine());
        var dic = new Dictionary<string, int>();
        for (int i = 0; i < num; ++i)
        {
            var key = Console.ReadLine();
            if (dic.ContainsKey(key)) dic[key]++; 
            else dic.Add(key, 1);
        }
        var max = dic.Values.Max();
        var count = num % 2 == 0 ? num / 2 : num / 2 + 1;
        Console.WriteLine(max <= count?"YES":"NO");
    }
}
0