結果

問題 No.2420 Simple Problem
ユーザー Kyoro IDKyoro ID
提出日時 2023-08-12 15:10:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 45,440 KB
最終ジャッジ日時 2024-04-30 08:17:15
合計ジャッジ時間 22,133 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
11,904 KB
testcase_01 AC 305 ms
25,600 KB
testcase_02 AC 48 ms
12,160 KB
testcase_03 AC 141 ms
17,024 KB
testcase_04 AC 537 ms
38,528 KB
testcase_05 AC 365 ms
28,800 KB
testcase_06 AC 669 ms
45,312 KB
testcase_07 AC 671 ms
45,312 KB
testcase_08 AC 676 ms
45,184 KB
testcase_09 AC 675 ms
45,184 KB
testcase_10 AC 675 ms
45,312 KB
testcase_11 AC 674 ms
45,312 KB
testcase_12 AC 674 ms
45,440 KB
testcase_13 AC 670 ms
45,312 KB
testcase_14 AC 671 ms
45,312 KB
testcase_15 AC 662 ms
45,312 KB
testcase_16 AC 671 ms
45,440 KB
testcase_17 AC 673 ms
45,312 KB
testcase_18 AC 669 ms
45,312 KB
testcase_19 AC 666 ms
45,312 KB
testcase_20 AC 674 ms
45,184 KB
testcase_21 AC 673 ms
45,312 KB
testcase_22 AC 663 ms
45,312 KB
testcase_23 AC 669 ms
45,312 KB
testcase_24 AC 676 ms
45,312 KB
testcase_25 AC 669 ms
45,312 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 45 ms
12,032 KB
testcase_33 AC 296 ms
25,344 KB
権限があれば一括ダウンロードができます

ソースコード

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