結果

問題 No.338 アンケート機能
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-03-14 15:29:46
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 288 ms / 2,000 ms
コード長 502 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 6,816 KB
実行使用メモリ 25,796 KB
最終ジャッジ日時 2024-04-25 15:58:26
合計ジャッジ時間 10,451 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 274 ms
25,636 KB
testcase_01 AC 281 ms
25,728 KB
testcase_02 AC 288 ms
25,472 KB
testcase_03 AC 277 ms
25,472 KB
testcase_04 AC 282 ms
25,472 KB
testcase_05 AC 286 ms
25,472 KB
testcase_06 AC 276 ms
25,688 KB
testcase_07 AC 265 ms
25,600 KB
testcase_08 AC 267 ms
25,472 KB
testcase_09 AC 268 ms
25,472 KB
testcase_10 AC 264 ms
25,472 KB
testcase_11 AC 261 ms
25,728 KB
testcase_12 AC 264 ms
25,600 KB
testcase_13 AC 265 ms
25,472 KB
testcase_14 AC 257 ms
25,584 KB
testcase_15 AC 256 ms
25,796 KB
testcase_16 AC 261 ms
25,728 KB
testcase_17 AC 259 ms
25,472 KB
testcase_18 AC 259 ms
25,472 KB
testcase_19 AC 262 ms
25,728 KB
testcase_20 AC 262 ms
25,472 KB
testcase_21 AC 258 ms
25,472 KB
testcase_22 AC 259 ms
25,600 KB
testcase_23 AC 259 ms
25,628 KB
testcase_24 AC 265 ms
25,472 KB
testcase_25 AC 263 ms
25,472 KB
testcase_26 AC 258 ms
25,724 KB
testcase_27 AC 269 ms
25,472 KB
testcase_28 AC 256 ms
25,600 KB
testcase_29 AC 256 ms
25,488 KB
testcase_30 AC 264 ms
25,600 KB
権限があれば一括ダウンロードができます

ソースコード

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