結果

問題 No.1129 Rating じゃんけん
ユーザー shi-moshi-mo
提出日時 2020-09-29 16:45:28
言語 Ruby
(3.3.0)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 11,432 KB
実行使用メモリ 15,340 KB
最終ジャッジ日時 2023-09-17 02:57:10
合計ジャッジ時間 3,063 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,084 KB
testcase_01 AC 82 ms
15,152 KB
testcase_02 AC 82 ms
15,220 KB
testcase_03 AC 81 ms
15,324 KB
testcase_04 AC 82 ms
15,116 KB
testcase_05 AC 82 ms
15,024 KB
testcase_06 AC 83 ms
15,248 KB
testcase_07 AC 81 ms
15,020 KB
testcase_08 AC 82 ms
15,340 KB
testcase_09 AC 82 ms
15,124 KB
testcase_10 AC 81 ms
15,284 KB
testcase_11 AC 81 ms
15,056 KB
testcase_12 AC 82 ms
15,328 KB
testcase_13 AC 82 ms
15,080 KB
testcase_14 AC 83 ms
15,020 KB
testcase_15 AC 82 ms
15,112 KB
testcase_16 AC 82 ms
15,180 KB
testcase_17 AC 82 ms
15,244 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

NameX = 'null'
NameY = 'tRue'
Draw  = 'Draw'

def winner(rx, hx, ry, hy)
  return NameX if ry < rx
  return NameY if rx < ry
  return Draw  if hx == hy
  case hx
  when 0
    (1 == hy) ? NameX : NameY
  when 1
    (2 == hy) ? NameX : NameY
  when 2
    (0 == hy) ? NameX : NameY
  end
end

a, b, c, d = gets.split.map(&:to_i)
puts winner(a, b, c, d)
0