結果

問題 No.275 中央値を求めよ
ユーザー moon17moon17
提出日時 2022-05-14 18:07:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 1,000 ms
コード長 213 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,400 KB
実行使用メモリ 70,788 KB
最終ジャッジ日時 2023-09-30 10:05:07
合計ジャッジ時間 5,255 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,776 KB
testcase_01 AC 73 ms
70,660 KB
testcase_02 AC 72 ms
70,576 KB
testcase_03 AC 71 ms
70,640 KB
testcase_04 AC 72 ms
70,636 KB
testcase_05 AC 72 ms
70,748 KB
testcase_06 AC 73 ms
70,700 KB
testcase_07 AC 73 ms
70,556 KB
testcase_08 AC 72 ms
70,664 KB
testcase_09 AC 71 ms
70,664 KB
testcase_10 AC 72 ms
70,732 KB
testcase_11 AC 71 ms
70,688 KB
testcase_12 AC 71 ms
70,600 KB
testcase_13 AC 72 ms
70,180 KB
testcase_14 AC 72 ms
70,400 KB
testcase_15 AC 73 ms
70,584 KB
testcase_16 AC 73 ms
70,612 KB
testcase_17 AC 72 ms
70,600 KB
testcase_18 AC 73 ms
70,656 KB
testcase_19 AC 72 ms
70,788 KB
testcase_20 AC 71 ms
70,648 KB
testcase_21 AC 73 ms
70,620 KB
testcase_22 AC 72 ms
70,728 KB
testcase_23 AC 73 ms
70,512 KB
testcase_24 AC 72 ms
70,432 KB
testcase_25 AC 73 ms
70,680 KB
testcase_26 AC 73 ms
70,396 KB
testcase_27 AC 73 ms
70,692 KB
testcase_28 AC 71 ms
70,656 KB
testcase_29 AC 73 ms
70,608 KB
testcase_30 AC 73 ms
70,544 KB
testcase_31 AC 72 ms
70,524 KB
testcase_32 AC 72 ms
70,636 KB
testcase_33 AC 72 ms
70,556 KB
testcase_34 AC 72 ms
70,624 KB
testcase_35 AC 71 ms
70,568 KB
testcase_36 AC 72 ms
70,540 KB
testcase_37 AC 71 ms
70,524 KB
testcase_38 AC 73 ms
70,636 KB
testcase_39 AC 72 ms
70,712 KB
testcase_40 AC 72 ms
70,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = sorted(list(map(int, input().split())))

#0, 1, 2 → N//2 = 1 ans=1
#0, 1, 2, 3 → N//2 = 2 ans=(1+2)/2

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