結果
問題 |
No.1801 Segment Game
|
ユーザー |
|
提出日時 | 2021-12-18 16:48:01 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 523 bytes |
コンパイル時間 | 120 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,392 KB |
最終ジャッジ日時 | 2024-11-14 11:44:51 |
合計ジャッジ時間 | 14,107 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 8 WA * 2 |
ソースコード
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")