結果
| 問題 |
No.2420 Simple Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-12 14:06:34 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 428 ms / 2,000 ms |
| コード長 | 314 bytes |
| コンパイル時間 | 194 ms |
| コンパイル使用メモリ | 82,436 KB |
| 実行使用メモリ | 103,900 KB |
| 最終ジャッジ日時 | 2024-11-19 17:22:49 |
| 合計ジャッジ時間 | 15,559 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 33 |
ソースコード
def isqrt(n):
if n == 0: return 0
x = 1 << (n.bit_length() + 1) // 2
y = (x + n // x) // 2
while y < x:
x = y
y = (x + n // x) // 2
return x
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]
for a, b in AB:
x = isqrt(a+b+isqrt(4*a*b))
print(x+1)