結果

問題 No.138 化石のバージョン
ユーザー neko_the_shadow
提出日時 2016-12-18 17:47:06
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 733 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 16,000 KB
最終ジャッジ日時 2024-12-29 14:15:29
合計ジャッジ時間 2,306 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve pivot-version version)
  (let* ((temp-pivot (map string->number (string-split pivot-version ".")))
         (temp (map string->number (string-split version ".")))
         (pivot-a (car temp-pivot))
         (pivot-b (cadr temp-pivot))
         (pivot-c (caddr temp-pivot))
         (a (car temp))
         (b (cadr temp))
         (c (caddr temp)))
    (cond 
      ((< pivot-a a) "NO")
      ((> pivot-a a) "YES")
      (else
        (cond
          ((< pivot-b b) "NO")
          ((> pivot-b b) "YES")
          (else
            (if (< pivot-c c)
              "NO"
              "YES")))))))


(let* ((pivot-version (read-line))
       (version (read-line)))
  (display (solve pivot-version version))
  (newline))
0