結果
問題 | No.275 中央値を求めよ |
ユーザー |
![]() |
提出日時 | 2015-10-13 00:09:12 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 26 ms / 1,000 ms |
コード長 | 350 bytes |
コンパイル時間 | 270 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,528 KB |
最終ジャッジ日時 | 2024-06-24 23:25:51 |
合計ジャッジ時間 | 1,951 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
N = int(input())scores = map (int, raw_input().split())if len(scores) % 2 == 1:while len(scores) > 1:scores.remove(max(scores))scores.remove(min(scores))median = scores[0]else:while len(scores) > 2:scores.remove(max(scores))scores.remove(min(scores))median = sum(scores)/2.0print median