結果

問題 No.2420 Simple Problem
ユーザー 👑 p-adicp-adic
提出日時 2023-08-15 08:49:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 794 ms / 2,000 ms
コード長 149 bytes
コンパイル時間 692 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2024-05-02 20:30:37
合計ジャッジ時間 24,826 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,096 KB
testcase_01 AC 380 ms
76,672 KB
testcase_02 AC 71 ms
70,656 KB
testcase_03 AC 186 ms
76,928 KB
testcase_04 AC 637 ms
77,184 KB
testcase_05 AC 425 ms
77,184 KB
testcase_06 AC 748 ms
76,800 KB
testcase_07 AC 764 ms
76,672 KB
testcase_08 AC 731 ms
76,928 KB
testcase_09 AC 727 ms
77,184 KB
testcase_10 AC 742 ms
76,672 KB
testcase_11 AC 729 ms
76,544 KB
testcase_12 AC 755 ms
76,800 KB
testcase_13 AC 746 ms
76,800 KB
testcase_14 AC 794 ms
77,056 KB
testcase_15 AC 774 ms
76,800 KB
testcase_16 AC 777 ms
77,312 KB
testcase_17 AC 786 ms
77,056 KB
testcase_18 AC 751 ms
77,184 KB
testcase_19 AC 743 ms
76,800 KB
testcase_20 AC 731 ms
77,312 KB
testcase_21 AC 734 ms
77,056 KB
testcase_22 AC 739 ms
76,672 KB
testcase_23 AC 735 ms
76,928 KB
testcase_24 AC 730 ms
76,416 KB
testcase_25 AC 722 ms
76,672 KB
testcase_26 AC 40 ms
52,224 KB
testcase_27 AC 611 ms
77,056 KB
testcase_28 AC 621 ms
77,440 KB
testcase_29 AC 583 ms
76,800 KB
testcase_30 AC 608 ms
76,928 KB
testcase_31 AC 615 ms
76,800 KB
testcase_32 AC 36 ms
51,840 KB
testcase_33 AC 349 ms
76,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I=input
N=int(I())
for i in range(N):
	A,B=map(int,I().split())
	X=int(pow(A,0.5)+pow(B,0.5))-2
	while 4*B*X*X>=(X*X-A+B)**2 or B>=X*X:X+=1
	print(X)
0