結果

問題 No.2420 Simple Problem
ユーザー moharan627moharan627
提出日時 2023-08-12 14:55:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 552 ms / 2,000 ms
コード長 754 bytes
コンパイル時間 934 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 83,092 KB
最終ジャッジ日時 2023-08-12 14:56:22
合計ジャッジ時間 20,274 ms
ジャッジサーバーID
(参考情報)
judge8 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
71,596 KB
testcase_01 AC 328 ms
79,580 KB
testcase_02 AC 116 ms
77,744 KB
testcase_03 AC 205 ms
78,812 KB
testcase_04 AC 470 ms
81,852 KB
testcase_05 AC 336 ms
80,752 KB
testcase_06 AC 547 ms
82,068 KB
testcase_07 AC 527 ms
81,856 KB
testcase_08 AC 552 ms
81,940 KB
testcase_09 AC 519 ms
82,816 KB
testcase_10 AC 525 ms
81,940 KB
testcase_11 AC 521 ms
83,092 KB
testcase_12 AC 521 ms
82,184 KB
testcase_13 AC 539 ms
82,652 KB
testcase_14 AC 527 ms
82,004 KB
testcase_15 AC 539 ms
82,952 KB
testcase_16 AC 525 ms
82,172 KB
testcase_17 AC 538 ms
82,980 KB
testcase_18 AC 520 ms
82,120 KB
testcase_19 AC 538 ms
82,280 KB
testcase_20 AC 530 ms
81,832 KB
testcase_21 AC 547 ms
82,148 KB
testcase_22 AC 524 ms
82,380 KB
testcase_23 AC 552 ms
81,956 KB
testcase_24 AC 522 ms
82,360 KB
testcase_25 AC 552 ms
81,964 KB
testcase_26 AC 96 ms
71,776 KB
testcase_27 AC 487 ms
81,664 KB
testcase_28 AC 492 ms
81,728 KB
testcase_29 AC 475 ms
82,560 KB
testcase_30 AC 469 ms
82,192 KB
testcase_31 AC 499 ms
81,420 KB
testcase_32 AC 94 ms
71,684 KB
testcase_33 AC 296 ms
80,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10**9 + 7
MOD2 = 998244353
from collections import defaultdict
def ceil(A,B):
    return -(-A//B)
def solve():
    def II(): return int(sys.stdin.readline())
    def LI(): return list(map(int, sys.stdin.readline().split()))
    def LC(): return list(sys.stdin.readline().rstrip())
    def IC(): return [int(c) for c in sys.stdin.readline().rstrip()]
    def MI(): return map(int, sys.stdin.readline().split())
    N = II()
    from math import sqrt
    for i in range(N):
        A,B = MI()
        T = int(sqrt(A) + sqrt(B))
        for x in range(max(1,T-5),T+5):
            if(2*A*B<x**4+A**2+B**2-2*A*x*x-2*B*x*x):
                print(x)
                break
    return
solve()
0