結果

問題 No.126 2基のエレベータ
ユーザー はむ吉🐹はむ吉🐹
提出日時 2017-01-08 12:10:14
言語 Scheme
(Gauche-0.9.14)
結果
RE  
実行時間 -
コード長 286 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 13,760 KB
最終ジャッジ日時 2023-08-22 17:34:20
合計ジャッジ時間 1,589 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 16 ms
11,740 KB
testcase_03 AC 15 ms
11,684 KB
testcase_04 AC 16 ms
11,932 KB
testcase_05 AC 16 ms
11,872 KB
testcase_06 AC 16 ms
11,884 KB
testcase_07 RE -
testcase_08 AC 16 ms
11,704 KB
testcase_09 AC 16 ms
11,688 KB
testcase_10 AC 16 ms
11,888 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 16 ms
11,940 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 16 ms
11,984 KB
testcase_19 AC 15 ms
11,896 KB
testcase_20 RE -
testcase_21 AC 15 ms
11,928 KB
testcase_22 AC 15 ms
11,888 KB
testcase_23 AC 16 ms
11,676 KB
testcase_24 AC 15 ms
11,796 KB
testcase_25 AC 16 ms
11,932 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve a b s)
    (let ((da (abs (- a s))) (db (abs (- b s))))
        (cond
            ((or (<= da db) (= s 1)) (+ da s))
            ((not (= a 0)) (+ db a (min (- s 1) k)))
            (else (+ t s 1)))))

(let* ((a (read)) (b (read)) (s (read)))
    (print (solve a b s)))
0