結果

問題 No.275 中央値を求めよ
ユーザー p_nixp_nix
提出日時 2018-01-26 01:00:19
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 640 bytes
コンパイル時間 4,296 ms
コンパイル使用メモリ 101,780 KB
実行使用メモリ 25,884 KB
最終ジャッジ日時 2023-08-27 05:54:42
合計ジャッジ時間 7,243 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
25,612 KB
testcase_01 AC 66 ms
25,640 KB
testcase_02 AC 67 ms
23,504 KB
testcase_03 WA -
testcase_04 AC 66 ms
25,576 KB
testcase_05 AC 67 ms
23,716 KB
testcase_06 AC 67 ms
23,732 KB
testcase_07 AC 74 ms
23,712 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 73 ms
23,684 KB
testcase_11 RE -
testcase_12 AC 63 ms
23,552 KB
testcase_13 WA -
testcase_14 AC 65 ms
23,656 KB
testcase_15 AC 75 ms
23,688 KB
testcase_16 AC 75 ms
23,744 KB
testcase_17 AC 75 ms
21,764 KB
testcase_18 AC 76 ms
25,872 KB
testcase_19 WA -
testcase_20 AC 74 ms
23,724 KB
testcase_21 AC 76 ms
25,692 KB
testcase_22 AC 76 ms
25,884 KB
testcase_23 WA -
testcase_24 AC 75 ms
23,740 KB
testcase_25 AC 74 ms
23,748 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 70 ms
21,892 KB
testcase_30 AC 62 ms
21,644 KB
testcase_31 AC 76 ms
23,876 KB
testcase_32 AC 70 ms
21,776 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 75 ms
23,788 KB
testcase_38 AC 77 ms
23,808 KB
testcase_39 WA -
testcase_40 AC 70 ms
21,788 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.Text;
using System.Threading.Tasks;

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

            Array.Sort(a);

            if (a.Length % 2 ==0)
            {
                Console.WriteLine((float)(a[a.Length / 2 -1] + a[a.Length / 2 ])/2);
            }
            else
            {
                Console.WriteLine(a[a.Length /2 + 1]);
            }

        }
    }
}
0