# coding: utf-8 # AtCoder Competition Template v2.1 SHORT (PyPy 7.3.20 / Python 3.11) ※yukicoder用に編集した物 # ↑ https://github.com/Rino-program/atcoder/blob/main/contests/.template/main.py # oj test -c 'C:\Rino-program\AtCoder\.venv-pypy311\Scripts\python.exe maina.py' -d input/a import sys import math # ===== 入出力ヘルパ ===== def input() -> str: return sys.stdin.readline().rstrip() def INT() -> int: return int(input()) def MAP(): return map(int, input().split()) def LIST() -> list[int]: return list(MAP()) def TUPLE() -> tuple[int, ...]: return tuple(MAP()) def TUPLES(n: int) -> list[tuple[int, ...]]: return [TUPLE() for _ in range(n)] # ===== 定数 ===== INF = 10 ** 18 # ===== 関数短縮 ===== pr = print en = enumerate # ===== よく使う出力関数 ===== def Yes(): print("Yes") def No(): print("No") def yn(cond: bool) -> None: """条件に応じてYes/No出力""" print("Yes" if cond else "No") # ===== デバッグ ===== def debug(*args, **kwargs) -> None: """デバッグ出力(標準エラー)""" print("[DEBUG]", *args, **kwargs, file=sys.stderr) # ============================================== # =================== main ===================== # ============================================== def main() -> None: # ここに解答を書く """B問題(保留中) # 答えは意外と小さそう N = INT() if N == 1: print("infinity") ans = 0 while N != 1: ans += 1 if N % 2: N = N * 3 + 1 else: N //= 2 pr(ans) """ # C問題 import numpy as np N = INT() data = LIST() data = np.array(data) Q1, Q2, Q3 = None, None, None # 事前に定義だけ if N % 2: Q1, Q2, Q3 = np.percentile(data, [25, 50, 75], method='weibull') else: Q1, Q2, Q3 = np.percentile(data, [25, 50, 75], method='averaged_inverted_cdf') IQR = Q3 - Q1 l = Q1 - 1.5 * IQR u = Q3 + 1.5 * IQR ans = np.sum((data < l) | (data > u)) print(Q1, Q2, Q3, ans) if __name__ == "__main__": main()