結果

問題 No.338 アンケート機能
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-03-14 15:29:46
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 299 ms / 2,000 ms
コード長 502 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 25,728 KB
最終ジャッジ日時 2024-11-08 03:07:13
合計ジャッジ時間 10,533 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

(use srfi-42)
(define (round-up-on-5 x) (truncate->exact (+ x (/ 1 2))))
(define (comp-min-a+b a0 b0 . max-a-b-opt)
    (let ((max-a-b (get-optional max-a-b-opt 500)))
        (min-ec
            (: a max-a-b)
            (: b max-a-b)
            (:let s (+ a b))
            (not (= s 0))
            (and
                (= a0 (round-up-on-5 (/ (* 100 a) s)))
                (= b0 (round-up-on-5 (/ (* 100 b) s))))
            s)))
(let* ((a0 (read)) (b0 (read)))
    (print (comp-min-a+b a0 b0)))
0