結果

問題 No.1801 Segment Game
ユーザー FromBooskaFromBooska
提出日時 2024-03-18 14:49:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 397 ms / 2,000 ms
コード長 767 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 77,140 KB
最終ジャッジ日時 2024-03-18 14:49:11
合計ジャッジ時間 6,104 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,332 KB
testcase_01 AC 389 ms
76,628 KB
testcase_02 AC 397 ms
77,012 KB
testcase_03 AC 397 ms
77,012 KB
testcase_04 AC 397 ms
77,140 KB
testcase_05 AC 394 ms
77,140 KB
testcase_06 AC 384 ms
77,140 KB
testcase_07 AC 343 ms
76,628 KB
testcase_08 AC 355 ms
76,756 KB
testcase_09 AC 389 ms
77,012 KB
testcase_10 AC 36 ms
53,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 取れるなら先手は対角線を取る、あとは同じ個数なので先手が勝つ
# 先手が対角線を取れない場合、後手が勝つ、D1以上なので先手が一手もできないことはない
# いや、対角線でなくていい、中心を通る線の最短のもの

T = int(input())
for t in range(T):
    H, W, D = map(int, input().split())
    ans = 'S'
    shortest_squared = H**2+W**2
    if H%2 == 0:
        shortest_squared = min(shortest_squared, W**2)
    else:
        shortest_squared = min(shortest_squared, 1**2+W**2)
    if W%2 == 0:
        shortest_squared = min(shortest_squared, H**2)
    else:
        shortest_squared = min(shortest_squared, 1**2+H**2)
    if shortest_squared<=D**2:
        ans = 'N'
    print(ans)
0