結果

問題 No.275 中央値を求めよ
ユーザー BE: SEVENTH
提出日時 2024-05-28 19:50:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 1,000 ms
コード長 425 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-20 20:53:39
合計ジャッジ時間 2,869 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
0