結果

問題 No.2420 Simple Problem
ユーザー prd_xxx
提出日時 2023-08-12 14:05:21
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 297 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 44,160 KB
最終ジャッジ日時 2024-11-19 17:24:18
合計ジャッジ時間 39,006 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 27 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N = int(input())
AB = [tuple(map(int,input().split())) for _ in range(N)]

for a,b in AB:
    v = a**0.5 + b**0.5
    for x in range(int(v)-2, int(v)+3):
        if a+b-x*x < -2*(a*b)**0.5:
            print(x)
            break
    else:
        assert False
0