結果

問題 No.275 中央値を求めよ
コンテスト
ユーザー ぺ鳥
提出日時 2022-06-04 15:22:07
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 228 ms / 1,000 ms
+ 207µs
コード長 343 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 301 ms
コンパイル使用メモリ 21,468 KB
実行使用メモリ 15,912 KB
最終ジャッジ日時 2026-09-01 09:59:58
合計ジャッジ時間 7,679 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())
num = list(map(int,input().split()))
for i in range(len(num)):
    for j in range(len(num)):
        if num[j] > num[i]:
            tmp = num[i]
            num[i]= num[j]
            num[j] = tmp
if len(num) % 2 == 0:
    print(f'{(num[len(num) // 2 - 1] + num[len(num) // 2]) / 2}')
else:
    print(f'{num[len(num) // 2]}')
0