結果

問題 No.921 ずんだアロー
ユーザー tsushimatsushima
提出日時 2019-11-08 21:32:37
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 753 bytes
コンパイル時間 1,409 ms
コンパイル使用メモリ 65,964 KB
実行使用メモリ 33,052 KB
最終ジャッジ日時 2023-10-13 03:34:08
合計ジャッジ時間 4,700 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
23,708 KB
testcase_01 AC 64 ms
21,672 KB
testcase_02 AC 64 ms
21,744 KB
testcase_03 AC 64 ms
21,684 KB
testcase_04 AC 64 ms
21,764 KB
testcase_05 WA -
testcase_06 AC 72 ms
19,696 KB
testcase_07 AC 71 ms
21,716 KB
testcase_08 AC 64 ms
21,800 KB
testcase_09 AC 64 ms
21,732 KB
testcase_10 AC 111 ms
30,208 KB
testcase_11 WA -
testcase_12 AC 82 ms
23,660 KB
testcase_13 AC 102 ms
29,376 KB
testcase_14 AC 107 ms
31,804 KB
testcase_15 AC 93 ms
25,732 KB
testcase_16 AC 75 ms
22,352 KB
testcase_17 AC 108 ms
31,876 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 115 ms
33,052 KB
testcase_24 AC 109 ms
27,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections;

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split().Select(int.Parse).ToArray();

            var div = n / 2;
            if (n % 2 == 1) div++;

            var dict = new Dictionary<int, int>();
            for (var i = 0; i < n; i++)
            {
                if (dict.ContainsKey(a[i]))
                    dict[a[i]]++;
                else
                    dict[a[i]] = 1;
            }

            var count = dict.Values.Max();

            Console.WriteLine(Math.Max(div, count));
        }
    }
}
0