結果

問題 No.2420 Simple Problem
ユーザー Konton7Konton7
提出日時 2023-09-02 05:41:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 824 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 1,395 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 77,820 KB
最終ジャッジ日時 2023-09-02 05:42:24
合計ジャッジ時間 28,915 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,496 KB
testcase_01 AC 354 ms
77,484 KB
testcase_02 AC 99 ms
76,904 KB
testcase_03 AC 197 ms
77,492 KB
testcase_04 AC 606 ms
77,392 KB
testcase_05 AC 409 ms
77,568 KB
testcase_06 AC 767 ms
77,512 KB
testcase_07 AC 809 ms
77,820 KB
testcase_08 AC 739 ms
77,404 KB
testcase_09 AC 753 ms
77,728 KB
testcase_10 AC 721 ms
77,384 KB
testcase_11 AC 748 ms
77,460 KB
testcase_12 AC 750 ms
77,460 KB
testcase_13 AC 733 ms
77,404 KB
testcase_14 AC 750 ms
77,624 KB
testcase_15 AC 774 ms
77,640 KB
testcase_16 AC 729 ms
77,352 KB
testcase_17 AC 757 ms
77,532 KB
testcase_18 AC 755 ms
77,812 KB
testcase_19 AC 774 ms
77,380 KB
testcase_20 AC 727 ms
77,384 KB
testcase_21 AC 772 ms
77,528 KB
testcase_22 AC 708 ms
77,132 KB
testcase_23 AC 824 ms
77,480 KB
testcase_24 AC 802 ms
77,724 KB
testcase_25 AC 718 ms
77,416 KB
testcase_26 AC 74 ms
71,120 KB
testcase_27 AC 602 ms
77,268 KB
testcase_28 AC 609 ms
77,428 KB
testcase_29 AC 624 ms
77,360 KB
testcase_30 AC 602 ms
77,132 KB
testcase_31 AC 621 ms
77,384 KB
testcase_32 AC 70 ms
71,332 KB
testcase_33 AC 365 ms
77,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
for _ in range(n):
	a, b = [int(v) for v in input().split()]
	ok = 64000
	ng = 0
	while abs(ok - ng) > 1:
		mid = (ok + ng) // 2
		if (mid ** 2 > (a + b)) and ((mid ** 2 - a - b) ** 2 - 4 * a * b > 0):
			ok = mid
		else:
			ng = mid
	print(ok)
0