結果

問題 No.201 yukicoderじゃんけん
ユーザー nonokai10
提出日時 2018-03-25 11:51:40
言語 Ruby
(3.4.1)
結果
AC  
実行時間 90 ms / 5,000 ms
コード長 290 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-06-25 05:42:23
合計ジャッジ時間 2,731 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:17: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Main.rb:1: warning: assigned but unused variable - c
Main.rb:2: warning: assigned but unused variable - f
Syntax OK

ソースコード

diff #

a, b, c = gets.split
d, e, f = gets.split
case b.size <=> e.size
when -1
  puts d
when 0
  (0...b.size).each do |i|
    case b[i] <=> e[i]
    when -1
      puts d
      break
    when 1
      puts a
      break
    end
    if i == b.size - 1
      puts -1
    end
  end
when 1
  puts a
end
0