結果
| 問題 |
No.1801 Segment Game
|
| コンテスト | |
| ユーザー |
FromBooska
|
| 提出日時 | 2024-03-18 14:49:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 385 ms / 2,000 ms |
| コード長 | 767 bytes |
| コンパイル時間 | 609 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 77,860 KB |
| 最終ジャッジ日時 | 2024-09-30 04:57:10 |
| 合計ジャッジ時間 | 5,364 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 |
ソースコード
# 取れるなら先手は対角線を取る、あとは同じ個数なので先手が勝つ
# 先手が対角線を取れない場合、後手が勝つ、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)
FromBooska