結果

問題 No.275 中央値を求めよ
ユーザー hkawa117hkawa117
提出日時 2015-09-10 23:04:29
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 151 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 6,572 KB
実行使用メモリ 6,100 KB
最終ジャッジ日時 2023-09-26 10:27:04
合計ジャッジ時間 2,685 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,864 KB
testcase_01 AC 11 ms
5,996 KB
testcase_02 AC 11 ms
5,940 KB
testcase_03 RE -
testcase_04 AC 12 ms
5,932 KB
testcase_05 AC 11 ms
5,844 KB
testcase_06 AC 11 ms
5,940 KB
testcase_07 AC 11 ms
5,892 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 11 ms
6,000 KB
testcase_11 RE -
testcase_12 AC 11 ms
5,864 KB
testcase_13 RE -
testcase_14 AC 12 ms
5,996 KB
testcase_15 AC 12 ms
5,864 KB
testcase_16 AC 12 ms
5,872 KB
testcase_17 AC 12 ms
6,092 KB
testcase_18 AC 11 ms
5,916 KB
testcase_19 RE -
testcase_20 AC 11 ms
5,904 KB
testcase_21 AC 12 ms
5,820 KB
testcase_22 AC 11 ms
5,896 KB
testcase_23 RE -
testcase_24 AC 11 ms
6,040 KB
testcase_25 AC 12 ms
6,060 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 12 ms
5,844 KB
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 AC 11 ms
6,004 KB
testcase_38 AC 11 ms
5,940 KB
testcase_39 RE -
testcase_40 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
A = sorted(map(float, raw_input().split()))

if len(A) % 2 == 0:
    print (A[N/2-1] + A[N/2]) / 2.0
else:
    print A[(N-1)/2.0]
0