結果

問題 No.275 中央値を求めよ
ユーザー lloyzlloyz
提出日時 2023-12-24 22:46:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 144 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 82,468 KB
実行使用メモリ 53,788 KB
最終ジャッジ日時 2024-09-27 13:50:00
合計ジャッジ時間 3,964 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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