結果

問題 No.275 中央値を求めよ
ユーザー c-yanc-yan
提出日時 2020-02-02 15:35:55
言語 Python3
(3.11.2 + numpy 1.24.2 + scipy 1.10.1)
結果
RE  
実行時間 -
コード長 153 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 7,948 KB
最終ジャッジ日時 2023-07-18 21:31:52
合計ジャッジ時間 2,259 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 16 ms
7,888 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 15 ms
7,752 KB
testcase_09 AC 16 ms
7,780 KB
testcase_10 RE -
testcase_11 AC 15 ms
7,716 KB
testcase_12 RE -
testcase_13 AC 15 ms
7,780 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 16 ms
7,772 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 16 ms
7,720 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 16 ms
7,724 KB
testcase_27 AC 16 ms
7,732 KB
testcase_28 AC 15 ms
7,780 KB
testcase_29 AC 16 ms
7,908 KB
testcase_30 AC 16 ms
7,724 KB
testcase_31 RE -
testcase_32 AC 16 ms
7,752 KB
testcase_33 AC 16 ms
7,724 KB
testcase_34 AC 16 ms
7,820 KB
testcase_35 AC 15 ms
7,812 KB
testcase_36 AC 16 ms
7,872 KB
testcase_37 RE -
testcase_38 RE -
testcase_39 AC 15 ms
7,924 KB
testcase_40 AC 16 ms
7,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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