結果

問題 No.1801 Segment Game
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-12-18 16:48:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-04-26 20:46:05
合計ジャッジ時間 14,217 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
11,264 KB
testcase_01 AC 1,458 ms
11,392 KB
testcase_02 AC 1,443 ms
11,136 KB
testcase_03 AC 1,435 ms
11,136 KB
testcase_04 AC 1,431 ms
11,264 KB
testcase_05 AC 1,440 ms
11,264 KB
testcase_06 AC 1,398 ms
11,264 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1,374 ms
11,264 KB
testcase_10 AC 33 ms
11,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import Decimal
from math import sqrt
t = int(input())
for _ in range(t):
    h, w, d = map(Decimal, input().split())
    if h % 2 == 0 and w % 2 == 0: d_min = min(sqrt(h ** 2), sqrt(w ** 2))
    if h % 2 == 0 and w % 2 == 1: d_min = min(sqrt(h ** 2 + Decimal("1")), sqrt(w ** 2))
    if h % 2 == 1 and w % 2 == 0: d_min = min(sqrt(h ** 2), sqrt(w ** 2 + Decimal("1")))
    if h % 2 == 1 and w % 2 == 1: d_min = min(sqrt(h ** 2 + Decimal("1")), sqrt(w ** 2 + Decimal("1")))
    print("N" if d_min <= d else "S")
0