結果

問題 No.2420 Simple Problem
ユーザー hotate29hotate29
提出日時 2023-10-07 00:00:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 825 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 492 ms
コンパイル使用メモリ 87,392 KB
実行使用メモリ 77,880 KB
最終ジャッジ日時 2023-10-07 00:00:47
合計ジャッジ時間 26,730 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,528 KB
testcase_01 AC 388 ms
77,720 KB
testcase_02 AC 102 ms
77,880 KB
testcase_03 AC 198 ms
77,492 KB
testcase_04 AC 651 ms
77,532 KB
testcase_05 AC 467 ms
77,680 KB
testcase_06 AC 758 ms
77,548 KB
testcase_07 AC 787 ms
77,552 KB
testcase_08 AC 801 ms
77,588 KB
testcase_09 AC 765 ms
77,332 KB
testcase_10 AC 813 ms
77,528 KB
testcase_11 AC 816 ms
77,660 KB
testcase_12 AC 750 ms
77,628 KB
testcase_13 AC 779 ms
77,464 KB
testcase_14 AC 768 ms
77,600 KB
testcase_15 AC 767 ms
77,736 KB
testcase_16 AC 797 ms
77,628 KB
testcase_17 AC 783 ms
77,672 KB
testcase_18 AC 789 ms
77,612 KB
testcase_19 AC 825 ms
77,616 KB
testcase_20 AC 776 ms
77,648 KB
testcase_21 AC 784 ms
77,772 KB
testcase_22 AC 802 ms
77,760 KB
testcase_23 AC 805 ms
77,664 KB
testcase_24 AC 796 ms
77,564 KB
testcase_25 AC 806 ms
77,340 KB
testcase_26 AC 73 ms
71,400 KB
testcase_27 AC 612 ms
77,616 KB
testcase_28 AC 628 ms
77,496 KB
testcase_29 AC 630 ms
77,496 KB
testcase_30 AC 637 ms
77,296 KB
testcase_31 AC 604 ms
77,532 KB
testcase_32 AC 71 ms
71,456 KB
testcase_33 AC 372 ms
77,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(X):
	return 4*A*B < (X*X - A - B)**2 and (X*X - A - B) >= 0

for _ in range(int(input())):
	A, B = map(int, input().split())

	ok = 100000
	ng = 0
	while (ok - ng) > 1:
		mid = (ok + ng) // 2
		if f(mid):
			ok = mid
		else:
			ng = mid

	print(ok)
0