結果

問題 No.275 中央値を求めよ
ユーザー wata_python
提出日時 2019-08-14 20:05:34
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 275 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-19 14:33:55
合計ジャッジ時間 3,108 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 2 WA * 10 RE * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = input()

S = list(A)         # リストに格納
while " " in S:     # " "の要素削除
    S.remove(" ")

S2 = sorted(S)

if N % 2 == 1:
    i = N/2 + 1
    ans = int(S2[i])
else:
    i = int(N/2)
    ans = (int(S2[i]) + int(S2[i-1])) / 2

print(ans)
0