結果

問題 No.275 中央値を求めよ
ユーザー yumenomatayumeyumenomatayume
提出日時 2020-03-21 01:13:16
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 151 bytes
コンパイル時間 516 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 79,420 KB
最終ジャッジ日時 2023-08-22 05:47:10
合計ジャッジ時間 7,045 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

n = int(input())
a = sorted(list(map(int,input().split())))
if n%2 == 1:
    ans = a[(n+1)/2]
else:
    ans = round((a[n//2]+a[n//2+1])/2,1)
print(ans)
0