結果
| 問題 |
No.275 中央値を求めよ
|
| コンテスト | |
| ユーザー |
tanakayo
|
| 提出日時 | 2020-12-17 15:47:12 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 547 ms / 1,000 ms |
| コード長 | 242 bytes |
| コンパイル時間 | 197 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 44,564 KB |
| 最終ジャッジ日時 | 2024-09-21 08:07:18 |
| 合計ジャッジ時間 | 23,860 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
import numpy as np
num = int(input())
data = np.array([int(x) for x in input().split(" ")])
data2 = sorted(data)
if num % 2 == 0:
output = (data2[int(num/2)-1] + data2[int(num/2)])/2.0
else:
output = data2[int(num/2)]
print(output)
tanakayo