結果
| 問題 |
No.2420 Simple Problem
|
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2023-08-12 13:35:29 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 474 ms / 2,000 ms |
| コード長 | 363 bytes |
| コンパイル時間 | 270 ms |
| コンパイル使用メモリ | 82,464 KB |
| 実行使用メモリ | 79,360 KB |
| 最終ジャッジ日時 | 2024-11-19 15:38:08 |
| 合計ジャッジ時間 | 15,962 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()
とりゐ