結果

問題 No.275 中央値を求めよ
ユーザー oldlevinoldlevin
提出日時 2020-02-21 07:37:15
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 3,772 ms
コンパイル使用メモリ 102,072 KB
実行使用メモリ 25,712 KB
最終ジャッジ日時 2023-07-30 04:51:42
合計ジャッジ時間 6,756 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 61 ms
21,592 KB
testcase_04 AC 61 ms
21,672 KB
testcase_05 WA -
testcase_06 AC 62 ms
23,544 KB
testcase_07 AC 70 ms
21,720 KB
testcase_08 AC 67 ms
21,768 KB
testcase_09 AC 69 ms
23,696 KB
testcase_10 WA -
testcase_11 AC 58 ms
21,612 KB
testcase_12 AC 60 ms
19,668 KB
testcase_13 AC 62 ms
23,700 KB
testcase_14 AC 61 ms
23,580 KB
testcase_15 WA -
testcase_16 AC 71 ms
21,864 KB
testcase_17 AC 69 ms
21,716 KB
testcase_18 WA -
testcase_19 AC 68 ms
21,724 KB
testcase_20 AC 69 ms
23,824 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 70 ms
23,848 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 70 ms
21,776 KB
testcase_27 AC 70 ms
21,760 KB
testcase_28 AC 62 ms
21,612 KB
testcase_29 AC 75 ms
21,736 KB
testcase_30 AC 63 ms
21,788 KB
testcase_31 AC 70 ms
21,720 KB
testcase_32 AC 68 ms
21,912 KB
testcase_33 AC 70 ms
21,748 KB
testcase_34 AC 63 ms
21,496 KB
testcase_35 AC 70 ms
23,788 KB
testcase_36 AC 71 ms
21,736 KB
testcase_37 AC 69 ms
23,804 KB
testcase_38 AC 76 ms
23,820 KB
testcase_39 AC 72 ms
23,748 KB
testcase_40 AC 70 ms
21,748 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;
using System.Text.RegularExpressions;
using static System.Console;

public class hello{
    public static void Main(){ //yukicoder No.275 中央値を求めよ 
    
        var n = int.Parse(ReadLine().Trim());
        var s = ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
        Array.Sort(s);
        //WriteLine(string.Join(" ",s));
        
        if(s.Length%2 == 1){
            WriteLine(s[(int)(s.Length/2)]);
        }else{
            var i = s.Length/2;
            var v = (s[i]+s[i-1])/2;
            WriteLine(v);
        }
    }
}
0