結果
問題 | No.275 中央値を求めよ |
ユーザー |
|
提出日時 | 2016-08-13 23:38:14 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 12 ms / 1,000 ms |
コード長 | 252 bytes |
コンパイル時間 | 173 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 23:59:39 |
合計ジャッジ時間 | 2,185 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
#!/usr/bin/python# -*- coding: utf-8 -*-import mathN = int(raw_input())array = map(int, raw_input().split())array.sort()if N % 2 != 0:print array[int(math.floor(N / 2.0))]else:print (array[N / 2] + array[N / 2 - 1 ] ) / 2.0