結果

問題 No.2420 Simple Problem
ユーザー Kyoro ID
提出日時 2023-08-12 15:10:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 45,312 KB
最終ジャッジ日時 2024-11-20 00:06:14
合計ジャッジ時間 22,249 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 27 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import logging
import math
input = sys.stdin.readline
logger = logging.getLogger(__name__)


def read():
    N = int(input().strip())
    AB = []
    for i in range(N):
        a, b = map(int, input().strip().split())
        AB.append((a, b))
    return N, AB


def solve(N, AB):
    for a, b in AB:
        xx = 2 * math.sqrt(a * b) + a + b
        ans = math.floor(math.sqrt(xx)) + 1
        print(ans)


if __name__ == "__main__":
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))
0