結果

問題 No.2420 Simple Problem
ユーザー titiatitia
提出日時 2023-08-19 06:37:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 847 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 848 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 78,904 KB
最終ジャッジ日時 2024-05-06 13:50:23
合計ジャッジ時間 25,631 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,840 KB
testcase_01 AC 337 ms
78,336 KB
testcase_02 AC 82 ms
76,032 KB
testcase_03 AC 237 ms
77,696 KB
testcase_04 AC 565 ms
77,696 KB
testcase_05 AC 576 ms
78,612 KB
testcase_06 AC 745 ms
77,696 KB
testcase_07 AC 656 ms
78,504 KB
testcase_08 AC 705 ms
77,056 KB
testcase_09 AC 704 ms
78,904 KB
testcase_10 AC 657 ms
77,056 KB
testcase_11 AC 729 ms
78,044 KB
testcase_12 AC 684 ms
77,184 KB
testcase_13 AC 741 ms
78,584 KB
testcase_14 AC 687 ms
77,824 KB
testcase_15 AC 658 ms
77,440 KB
testcase_16 AC 721 ms
78,376 KB
testcase_17 AC 686 ms
77,720 KB
testcase_18 AC 676 ms
77,992 KB
testcase_19 AC 675 ms
77,824 KB
testcase_20 AC 650 ms
77,736 KB
testcase_21 AC 666 ms
77,184 KB
testcase_22 AC 847 ms
78,040 KB
testcase_23 AC 714 ms
78,720 KB
testcase_24 AC 682 ms
77,440 KB
testcase_25 AC 699 ms
77,440 KB
testcase_26 AC 36 ms
52,224 KB
testcase_27 AC 536 ms
77,696 KB
testcase_28 AC 551 ms
77,312 KB
testcase_29 AC 567 ms
77,184 KB
testcase_30 AC 684 ms
77,184 KB
testcase_31 AC 541 ms
77,184 KB
testcase_32 AC 38 ms
52,224 KB
testcase_33 AC 375 ms
77,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt

N=int(input())

for i in range(N):
    a,b=map(int,input().split())
    t=round(sqrt(a)+sqrt(b))

    for x in range(max(1,t-3),t+4):
        if 2*x*x*a+2*x*x*b<x*x*x*x+a*a+b*b-2*a*b:
            print(x)
            break
        
0