結果
| 問題 | No.3632 IQR |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-21 22:33:18 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 657 ms / 2,000 ms |
| + 265µs | |
| コード長 | 2,083 bytes |
| 記録 | |
| コンパイル時間 | 292 ms |
| コンパイル使用メモリ | 21,412 KB |
| 実行使用メモリ | 76,936 KB |
| 最終ジャッジ日時 | 2026-08-21 22:34:04 |
| 合計ジャッジ時間 | 45,704 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 63 |
ソースコード
# 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)
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()