結果

問題 No.91 赤、緑、青の石
ユーザー neko_the_shadow
提出日時 2016-11-06 13:00:11
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 1,716 ms / 5,000 ms
コード長 451 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 20,992 KB
最終ジャッジ日時 2024-06-24 07:02:34
合計ジャッジ時間 18,297 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve x y z)
    (let loop ((cnt 0)
               (smaller (- y x))
               (bigger (- z x)))
      (if (or (< smaller 1) (< bigger 3))
        (+ x
           cnt
           (max (quotient smaller 5) (quotient bigger 5)))
        (apply loop (+ cnt 1) (sort (list (- smaller 1) (- bigger 3)))))))

(define (MAIN)
  (let ((args (map string->number (string-split (read-line) #\space))))
    (print (apply solve (sort args)))))

(MAIN)
0