結果

問題 No.2420 Simple Problem
ユーザー Kyoro ID
提出日時 2023-08-12 15:03:30
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 617 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 85,376 KB
最終ジャッジ日時 2024-11-19 23:10:40
合計ジャッジ時間 75,158 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7 TLE * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import logging
import math
from decimal import Decimal, ROUND_FLOOR
input = sys.stdin.readline
logger = logging.getLogger(__name__)


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


def solve(N, AB):
    for a, b in AB:
        ab = a.sqrt() + b.sqrt()
        ans = ab.quantize(Decimal("1."), rounding=ROUND_FLOOR) + 1
        print(ans)


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