結果
問題 |
No.1129 Rating じゃんけん
|
ユーザー |
|
提出日時 | 2022-05-02 21:10:32 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 499 bytes |
コンパイル時間 | 251 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-07-02 01:18:11 |
合計ジャッジ時間 | 2,690 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 WA * 1 |
コンパイルメッセージ
Syntax OK
ソースコード
class RockPaperScissors ROCK = 0 Scissor = 1 Paper = 2 COMPATIBLE_TABLE = {ROCK => Scissor, Scissor => Paper, Paper => ROCK} def self.win?(player_hand, rival_hand) return false if COMPATIBLE_TABLE[player_hand] != rival_hand true end def self.winner a, b, c, d = gets.split.map(&:to_i) return 'null' if a > c return 'tRue' if a < c return 'null' if self.win?(b, d) return 'tRue' unless self.win?(b, d) 'Draw' end end puts RockPaperScissors.winner