結果

問題 No.1801 Segment Game
ユーザー simansiman
提出日時 2022-01-11 23:16:31
言語 Ruby
(3.3.0)
結果
AC  
実行時間 332 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-04-26 21:13:06
合計ジャッジ時間 4,178 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
12,032 KB
testcase_01 AC 313 ms
12,160 KB
testcase_02 AC 308 ms
12,160 KB
testcase_03 AC 307 ms
12,544 KB
testcase_04 AC 311 ms
12,160 KB
testcase_05 AC 315 ms
12,160 KB
testcase_06 AC 306 ms
12,160 KB
testcase_07 AC 326 ms
12,288 KB
testcase_08 AC 332 ms
12,288 KB
testcase_09 AC 309 ms
12,288 KB
testcase_10 AC 79 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

T = gets.to_i

T.times do
  h, w, d = gets.split.map(&:to_i)
  e = h ** 2 + w ** 2
  f = h ** 2 + 1
  g = 1 + w ** 2

  if e <= d ** 2
    puts 'N'
  elsif f <= d ** 2 && w.odd?
    puts 'N'
  elsif g <= d ** 2 && h.odd?
    puts 'N'
  elsif h <= d && w.even?
    puts 'N'
  elsif w <= d && h.even?
    puts 'N'
  else
    puts 'S'
  end
end
0