結果

問題 No.275 中央値を求めよ
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-07-06 00:32:30
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 387 bytes
コンパイル時間 2,400 ms
コンパイル使用メモリ 103,604 KB
実行使用メモリ 25,776 KB
最終ジャッジ日時 2023-09-13 18:03:42
合計ジャッジ時間 6,582 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 WA -
testcase_03 AC 64 ms
21,708 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 71 ms
21,928 KB
testcase_09 AC 70 ms
23,888 KB
testcase_10 WA -
testcase_11 AC 62 ms
21,600 KB
testcase_12 RE -
testcase_13 AC 63 ms
19,596 KB
testcase_14 AC 64 ms
23,676 KB
testcase_15 WA -
testcase_16 AC 73 ms
21,856 KB
testcase_17 AC 72 ms
21,880 KB
testcase_18 WA -
testcase_19 AC 71 ms
22,004 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 72 ms
21,756 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 74 ms
21,928 KB
testcase_27 AC 72 ms
21,848 KB
testcase_28 AC 64 ms
21,788 KB
testcase_29 AC 72 ms
21,968 KB
testcase_30 AC 64 ms
23,828 KB
testcase_31 WA -
testcase_32 AC 70 ms
23,844 KB
testcase_33 AC 71 ms
23,952 KB
testcase_34 AC 62 ms
21,764 KB
testcase_35 AC 72 ms
21,816 KB
testcase_36 AC 70 ms
21,824 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 71 ms
23,732 KB
testcase_40 AC 71 ms
21,912 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;

class No275{
    static void Main(){
        var n=Int32.Parse(Console.ReadLine());
        var i=Console.ReadLine().Split(' ').Select(x=>Int32.Parse(x)).OrderBy(x=>x).ToArray();
        var b=n%2;
        if(b!=0){
            Console.WriteLine(i[n/2]);
        }else{
            n/=2;
            Console.WriteLine((i[n]+i[n+1])/2);
        }
    }
}
0