結果

問題 No.138 化石のバージョン
ユーザー RinRin
提出日時 2015-09-05 20:07:07
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 1,350 bytes
コンパイル時間 62 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 13,604 KB
最終ジャッジ日時 2023-08-28 13:31:32
合計ジャッジ時間 2,273 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,864 KB
testcase_01 AC 18 ms
11,888 KB
testcase_02 AC 18 ms
13,604 KB
testcase_03 AC 18 ms
11,652 KB
testcase_04 AC 17 ms
11,692 KB
testcase_05 AC 18 ms
11,676 KB
testcase_06 AC 17 ms
11,556 KB
testcase_07 AC 18 ms
11,816 KB
testcase_08 AC 18 ms
11,656 KB
testcase_09 AC 18 ms
11,820 KB
testcase_10 AC 18 ms
11,660 KB
testcase_11 AC 18 ms
11,836 KB
testcase_12 AC 18 ms
11,868 KB
testcase_13 AC 19 ms
13,600 KB
testcase_14 AC 18 ms
11,636 KB
testcase_15 AC 18 ms
11,732 KB
testcase_16 AC 18 ms
11,640 KB
testcase_17 AC 18 ms
11,812 KB
testcase_18 AC 18 ms
11,848 KB
testcase_19 AC 19 ms
11,756 KB
testcase_20 AC 18 ms
11,872 KB
testcase_21 AC 17 ms
11,880 KB
testcase_22 AC 17 ms
11,912 KB
testcase_23 AC 18 ms
11,732 KB
testcase_24 AC 17 ms
11,740 KB
testcase_25 AC 18 ms
11,756 KB
testcase_26 AC 18 ms
11,724 KB
testcase_27 AC 18 ms
11,644 KB
testcase_28 AC 17 ms
11,680 KB
testcase_29 AC 18 ms
11,656 KB
testcase_30 AC 17 ms
11,564 KB
testcase_31 AC 18 ms
11,732 KB
testcase_32 AC 17 ms
11,844 KB
testcase_33 AC 18 ms
11,680 KB
testcase_34 AC 18 ms
11,836 KB
testcase_35 AC 18 ms
11,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (System.out.println x)
  (begin
    (display x)
    (newline)
  )
)

(define (ver2num x)
  (let loop(
            (i 0)
            (foo 0)
            (bar '())
           )
    (if (= i (length x))
        (if (< foo 10)
            (string->number (apply string-append (reverse (cons (string-append "00" (number->string foo)) bar))))
            (if (< foo 100)
                (string->number (apply string-append (reverse (cons (string-append "0" (number->string foo)) bar))))
                (string->number (apply string-append (reverse (cons (number->string foo) bar))))
            )
        )
        (if (string=? (list->string (list (list-ref x i))) ".")
            (if (< foo 10)
                (loop (+ i 1) 0 (cons (string-append "00" (number->string foo)) bar))
                (if (< foo 100)
                    (loop (+ i 1) 0 (cons (string-append "0" (number->string foo)) bar))
                    (loop (+ i 1) 0 (cons (number->string foo) bar))
                )
            )
            (loop (+ i 1) (+ (* foo 10) (string->number (list->string (list (list-ref x i))))) bar)
        )
    )
  )
)

(let (
      (X (string->list (symbol->string (read))))
      (Y (string->list (symbol->string (read))))
     )
  (if (>= (ver2num X) (ver2num Y))
      (System.out.println "YES")
      (System.out.println "NO")
  )
)
0