結果
| 問題 | No.275 中央値を求めよ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-27 21:58:18 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 100 ms / 1,000 ms |
| コード長 | 232 bytes |
| 記録 | |
| コンパイル時間 | 499 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 15,356 KB |
| 最終ジャッジ日時 | 2026-04-04 15:04:26 |
| 合計ジャッジ時間 | 5,724 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge5_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
N = int(input())
I = map(int, input().split(' '))
sort_i = sorted(I)
if len(sort_i) % 2 == 1:
res = sort_i[(len(sort_i) - 1) // 2]
else:
res = (sort_i[(len(sort_i)) // 2] + sort_i[(len(sort_i)) // 2 - 1]) / 2
print(res)