結果

問題 No.275 中央値を求めよ
ユーザー tnoda_
提出日時 2015-09-07 19:19:48
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 189 bytes
コンパイル時間 225 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-07-19 04:54:06
合計ジャッジ時間 1,866 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 2 WA * 32 RE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()
A = map(int, raw_input().split())
if N % 2 == 1:
    print(A[N/2+1])
else:
    ans = A[N/2] + A[N/2+1]
    if ans % 2 == 0:
        print(ans/2)
    else:
        print(ans*0.5)
0