結果

問題 No.275 中央値を求めよ
ユーザー tanakayotanakayo
提出日時 2020-12-17 15:47:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 498 ms / 1,000 ms
コード長 242 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 11,872 KB
実行使用メモリ 42,548 KB
最終ジャッジ日時 2023-10-21 06:58:27
合計ジャッジ時間 18,669 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 404 ms
42,548 KB
testcase_01 AC 412 ms
42,548 KB
testcase_02 AC 428 ms
42,548 KB
testcase_03 AC 415 ms
42,548 KB
testcase_04 AC 414 ms
42,548 KB
testcase_05 AC 402 ms
42,548 KB
testcase_06 AC 498 ms
42,548 KB
testcase_07 AC 400 ms
42,548 KB
testcase_08 AC 411 ms
42,548 KB
testcase_09 AC 399 ms
42,548 KB
testcase_10 AC 400 ms
42,548 KB
testcase_11 AC 415 ms
42,548 KB
testcase_12 AC 417 ms
42,548 KB
testcase_13 AC 408 ms
42,548 KB
testcase_14 AC 420 ms
42,548 KB
testcase_15 AC 414 ms
42,548 KB
testcase_16 AC 414 ms
42,548 KB
testcase_17 AC 424 ms
42,548 KB
testcase_18 AC 417 ms
42,548 KB
testcase_19 AC 409 ms
42,548 KB
testcase_20 AC 419 ms
42,548 KB
testcase_21 AC 427 ms
42,548 KB
testcase_22 AC 410 ms
42,548 KB
testcase_23 AC 408 ms
42,548 KB
testcase_24 AC 411 ms
42,548 KB
testcase_25 AC 414 ms
42,548 KB
testcase_26 AC 403 ms
42,548 KB
testcase_27 AC 405 ms
42,548 KB
testcase_28 AC 402 ms
42,548 KB
testcase_29 AC 411 ms
42,548 KB
testcase_30 AC 405 ms
42,548 KB
testcase_31 AC 417 ms
42,548 KB
testcase_32 AC 415 ms
42,548 KB
testcase_33 AC 403 ms
42,548 KB
testcase_34 AC 418 ms
42,548 KB
testcase_35 AC 429 ms
42,548 KB
testcase_36 AC 416 ms
42,548 KB
testcase_37 AC 411 ms
42,548 KB
testcase_38 AC 416 ms
42,548 KB
testcase_39 AC 420 ms
42,548 KB
testcase_40 AC 416 ms
42,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

num = int(input())
data = np.array([int(x) for x in input().split(" ")])

data2 = sorted(data)
if num % 2 == 0:
    output = (data2[int(num/2)-1] + data2[int(num/2)])/2.0
else:
    output = data2[int(num/2)]

print(output)
0