結果

問題 No.275 中央値を求めよ
ユーザー yumenomatayume
提出日時 2020-03-21 01:15:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 1,000 ms
コード長 154 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 81,864 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-12-16 00:30:31
合計ジャッジ時間 3,340 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

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