結果

問題 No.138 化石のバージョン
コンテスト
ユーザー mesh1nek0x0
提出日時 2018-07-09 23:30:48
言語 Ruby
(4.0.2)
コンパイル:
ruby -w -c _filename_
実行:
ruby _filename_
結果
AC  
実行時間 51 ms / 5,000 ms
+ 879µs
コード長 358 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9 ms
コンパイル使用メモリ 8,832 KB
実行使用メモリ 14,720 KB
最終ジャッジ日時 2026-08-16 03:27:13
合計ジャッジ時間 3,957 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #
raw source code

#!/bin/ruby
input = gets.chomp.split('.')
oldA = input[0].to_i
oldB = input[1].to_i
oldC = input[2].to_i

input = gets.chomp.split('.')
currentA = input[0].to_i
currentB = input[1].to_i
currentC = input[2].to_i

old = oldA * 10201 + oldB * 101 + oldC
current = currentA * 10201 + currentB * 101 + currentC

if current <= old
  puts 'YES'
else
  puts 'NO'
end
0