結果

問題 No.138 化石のバージョン
ユーザー mesh1nek0x0mesh1nek0x0
提出日時 2018-07-09 23:22:13
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 347 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-07-18 00:26:39
合計ジャッジ時間 4,937 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 WA * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/bin/ruby

input = gets.chomp(' ')
oldA = input[0].to_i
oldB = input[1].to_i
oldC = input[2].to_i

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

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

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