結果

問題 No.275 中央値を求めよ
ユーザー noriocnorioc
提出日時 2022-11-28 19:25:56
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 92 ms / 1,000 ms
コード長 178 bytes
コンパイル時間 532 ms
使用メモリ 75,920 KB
最終ジャッジ日時 2022-11-28 19:26:02
合計ジャッジ時間 5,842 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 78 ms
75,904 KB
testcase_01 AC 84 ms
75,620 KB
testcase_02 AC 92 ms
75,804 KB
testcase_03 AC 83 ms
75,796 KB
testcase_04 AC 78 ms
75,760 KB
testcase_05 AC 79 ms
75,468 KB
testcase_06 AC 76 ms
75,776 KB
testcase_07 AC 79 ms
75,532 KB
testcase_08 AC 78 ms
75,800 KB
testcase_09 AC 79 ms
75,756 KB
testcase_10 AC 76 ms
75,472 KB
testcase_11 AC 78 ms
75,744 KB
testcase_12 AC 78 ms
75,728 KB
testcase_13 AC 78 ms
75,692 KB
testcase_14 AC 78 ms
75,692 KB
testcase_15 AC 78 ms
75,560 KB
testcase_16 AC 86 ms
75,720 KB
testcase_17 AC 87 ms
75,748 KB
testcase_18 AC 75 ms
75,888 KB
testcase_19 AC 76 ms
75,760 KB
testcase_20 AC 76 ms
75,800 KB
testcase_21 AC 79 ms
75,660 KB
testcase_22 AC 79 ms
75,892 KB
testcase_23 AC 79 ms
75,796 KB
testcase_24 AC 77 ms
75,592 KB
testcase_25 AC 77 ms
75,920 KB
testcase_26 AC 77 ms
75,636 KB
testcase_27 AC 79 ms
75,548 KB
testcase_28 AC 79 ms
75,788 KB
testcase_29 AC 79 ms
75,524 KB
testcase_30 AC 81 ms
75,692 KB
testcase_31 AC 84 ms
75,704 KB
testcase_32 AC 86 ms
75,624 KB
testcase_33 AC 80 ms
75,756 KB
testcase_34 AC 77 ms
75,468 KB
testcase_35 AC 79 ms
75,492 KB
testcase_36 AC 79 ms
75,800 KB
testcase_37 AC 80 ms
75,516 KB
testcase_38 AC 81 ms
75,484 KB
testcase_39 AC 80 ms
75,812 KB
testcase_40 AC 80 ms
75,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

A.sort()
if len(A) % 2 == 0:
    p = N // 2 - 1
    m = sum(A[p:p+2]) / 2
    print(m)
else:
    m = A[N // 2]
    print(m)
0