結果

問題 No.201 yukicoderじゃんけん
コンテスト
ユーザー nonokai10
提出日時 2018-03-25 11:51:40
言語 Ruby
(4.0.9 + ACL)
コンパイル:
ruby -w -c _filename_
実行:
ruby --yjit _filename_
結果
AC  
実行時間 63 ms / 5,000 ms
+ 367µs
コード長 290 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 347 ms
コンパイル使用メモリ 8,704 KB
実行使用メモリ 14,464 KB
最終ジャッジ日時 2026-11-04 15:53:47
合計ジャッジ時間 3,053 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #
raw source code

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