結果

問題 No.1346 Rectangle
ユーザー gew1fw
提出日時 2025-06-12 19:51:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 214 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 81,800 KB
実行使用メモリ 53,980 KB
最終ジャッジ日時 2025-06-12 19:52:17
合計ジャッジ時間 1,605 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 2 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())

if n == 2:
    print("INF")
else:
    target = n - 1
    sqrt_val = math.isqrt(8 * target)
    m = (1 + sqrt_val) // 2
    while m * (m - 1) // 2 < target:
        m += 1
    print(m)
0