結果
| 問題 | No.2420 Simple Problem |
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2023-08-12 13:35:29 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 279 ms / 2,000 ms |
| + 308µs | |
| コード長 | 363 bytes |
| 記録 | |
| コンパイル時間 | 68 ms |
| コンパイル使用メモリ | 81,940 KB |
| 実行使用メモリ | 85,472 KB |
| 最終ジャッジ日時 | 2026-09-26 17:08:23 |
| 合計ジャッジ時間 | 15,661 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()
とりゐ