結果

問題 No.3632 IQR
コンテスト
ユーザー titia
提出日時 2026-08-25 06:09:30
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 432 ms / 2,000 ms
+ 860µs
コード長 389 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 306 ms
コンパイル使用メモリ 21,536 KB
実行使用メモリ 58,956 KB
最終ジャッジ日時 2026-08-25 06:09:44
合計ジャッジ時間 13,977 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 63
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))

A.sort()

def med(A):
    if len(A)%2==1:
        return A[len(A)//2]
    else:
        a=A[len(A)//2-1]
        b=A[len(A)//2]
        return (a+b)/2

Q1=med(A[:N//2])
Q2=med(A)
Q3=med(A[-(N//2):])

ANS=0
IQR=Q3-Q1
for a in A:
    if a<Q1-1.5*IQR or a>Q3+1.5*IQR:
        ANS+=1

print(Q1,Q2,Q3,ANS)
0