結果
問題 | No.138 化石のバージョン |
ユーザー |
|
提出日時 | 2015-10-13 23:28:47 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 102 ms / 5,000 ms |
コード長 | 357 bytes |
コンパイル時間 | 149 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-12-29 13:35:38 |
合計ジャッジ時間 | 5,046 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
コンパイルメッセージ
Syntax OK
ソースコード
def judge_method(fossil,array,index) case array[index] <=> fossil[index] when 1 puts "NO" when -1 puts "YES" when 0 if index == fossil.size - 1 puts "YES" else judge_method(fossil,array,index + 1) end end end fossil = gets.chomp.split(".").map(&:to_i) judge_array = gets.chomp.split(".").map(&:to_i) judge_method(fossil,judge_array,0)