結果

問題 No.275 中央値を求めよ
ユーザー nikuzuki
提出日時 2016-06-13 16:56:43
言語 Python2
(2.7.18)
結果
AC  
実行時間 13 ms / 1,000 ms
コード長 161 bytes
コンパイル時間 129 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-06-24 23:51:27
合計ジャッジ時間 1,652 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(raw_input())
a = []
a = map(int, raw_input().split())
a.sort()

if x % 2 == 1:
    print a[int(x / 2)]
else:
    print (a[x / 2] + a[(x / 2) - 1]) / 2.0
0