結果
| 問題 | No.2420 Simple Problem |
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2023-08-12 13:35:29 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 296 ms / 2,000 ms |
| コード長 | 363 bytes |
| 記録 | |
| コンパイル時間 | 856 ms |
| コンパイル使用メモリ | 85,040 KB |
| 実行使用メモリ | 83,664 KB |
| 最終ジャッジ日時 | 2026-05-13 21:36:25 |
| 合計ジャッジ時間 | 11,716 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 33 |
ソースコード
from sys import stdin
input=lambda :stdin.readline()[:-1]
def check(a,b,x):
y=x*x-a-b
if y>0 and y*y>4*a*b:
return True
return False
def solve():
a,b=map(int,input().split())
ng,ok=-1,3*10**9
while abs(ng-ok)>1:
mid=(ng+ok)//2
if check(a,b,mid):
ok=mid
else:
ng=mid
print(ok)
for _ in range(int(input())):
solve()
とりゐ