結果

問題 No.275 中央値を求めよ
コンテスト
ユーザー T
提出日時 2025-11-16 09:04:42
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 50 ms / 1,000 ms
コード長 178 bytes
記録
コンパイル時間 307 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2025-11-16 09:04:46
合計ジャッジ時間 3,296 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())
num = list(map(int, input().split()))
num.sort()
if (N % 2 == 0):
	half = N // 2
	CH =(num[half-1] +num[half])/2
else:
	half = (N // 2)
	CH = num[half]
print(CH)
0