結果

問題 No.275 中央値を求めよ
ユーザー ああああ
提出日時 2024-03-05 22:59:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 130 bytes
コンパイル時間 1,441 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 9,984 KB
最終ジャッジ日時 2024-03-05 22:59:23
合計ジャッジ時間 3,185 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 WA -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 WA -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 WA -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 WA -
testcase_24 RE -
testcase_25 RE -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 27 ms
9,856 KB
testcase_30 AC 28 ms
9,856 KB
testcase_31 RE -
testcase_32 AC 27 ms
9,856 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 RE -
testcase_38 RE -
testcase_39 WA -
testcase_40 AC 27 ms
9,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a=int(input())
b=list(map(int,input().split()))
b.sort()
if len(b)%2==0:
	print(b[len(b)/2])
else:
	c=a//2
	print((b[c]+b[c+1])/2)
0