結果

問題 No.275 中央値を求めよ
ユーザー brthyyjpbrthyyjp
提出日時 2020-10-09 18:15:31
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 88 ms / 1,000 ms
コード長 133 bytes
コンパイル時間 276 ms
使用メモリ 75,852 KB
最終ジャッジ日時 2023-02-19 01:46:54
合計ジャッジ時間 6,269 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 84 ms
75,736 KB
testcase_01 AC 84 ms
75,512 KB
testcase_02 AC 84 ms
75,824 KB
testcase_03 AC 84 ms
75,336 KB
testcase_04 AC 84 ms
75,704 KB
testcase_05 AC 85 ms
75,404 KB
testcase_06 AC 84 ms
75,392 KB
testcase_07 AC 84 ms
75,336 KB
testcase_08 AC 85 ms
75,544 KB
testcase_09 AC 85 ms
75,712 KB
testcase_10 AC 84 ms
75,404 KB
testcase_11 AC 84 ms
75,820 KB
testcase_12 AC 86 ms
75,584 KB
testcase_13 AC 85 ms
75,672 KB
testcase_14 AC 86 ms
75,388 KB
testcase_15 AC 88 ms
75,520 KB
testcase_16 AC 86 ms
75,708 KB
testcase_17 AC 87 ms
75,616 KB
testcase_18 AC 88 ms
75,448 KB
testcase_19 AC 85 ms
75,516 KB
testcase_20 AC 85 ms
75,728 KB
testcase_21 AC 87 ms
75,852 KB
testcase_22 AC 85 ms
75,416 KB
testcase_23 AC 85 ms
75,700 KB
testcase_24 AC 84 ms
75,816 KB
testcase_25 AC 86 ms
75,828 KB
testcase_26 AC 86 ms
75,724 KB
testcase_27 AC 86 ms
75,680 KB
testcase_28 AC 84 ms
75,540 KB
testcase_29 AC 85 ms
75,340 KB
testcase_30 AC 85 ms
75,716 KB
testcase_31 AC 84 ms
75,360 KB
testcase_32 AC 85 ms
75,460 KB
testcase_33 AC 84 ms
75,568 KB
testcase_34 AC 84 ms
75,724 KB
testcase_35 AC 84 ms
75,416 KB
testcase_36 AC 84 ms
75,728 KB
testcase_37 AC 85 ms
75,780 KB
testcase_38 AC 85 ms
75,548 KB
testcase_39 AC 85 ms
75,812 KB
testcase_40 AC 85 ms
75,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
A.sort()
if n%2 == 1:
    print(A[n//2])
else:
    print((A[n//2-1]+A[n//2])/2)
0