結果
| 問題 | No.275 中央値を求めよ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-28 19:50:36 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 21 ms / 1,000 ms |
| + 547µs | |
| コード長 | 425 bytes |
| 記録 | |
| コンパイル時間 | 57 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-10-05 07:50:05 |
| 合計ジャッジ時間 | 3,316 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
def main():
N = int(input())
number_list = list(map(int, input().split()))
material_counts = len(number_list)
number_list.sort()
half_material_counts = material_counts // 2
if material_counts % 2 == 0:
ans = (number_list[half_material_counts - 1] + number_list[half_material_counts]) / 2
print(ans)
else:
ans = number_list[half_material_counts]
print(ans)
if __name__ == '__main__':
main()