結果

問題 No.91 赤、緑、青の石
ユーザー neko_the_shadowneko_the_shadow
提出日時 2016-11-06 13:00:11
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 1,659 ms / 5,000 ms
コード長 451 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 15,600 KB
最終ジャッジ日時 2023-09-06 12:25:38
合計ジャッジ時間 17,359 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,117 ms
15,600 KB
testcase_01 AC 762 ms
15,328 KB
testcase_02 AC 500 ms
15,348 KB
testcase_03 AC 870 ms
15,416 KB
testcase_04 AC 394 ms
15,548 KB
testcase_05 AC 961 ms
15,536 KB
testcase_06 AC 109 ms
15,340 KB
testcase_07 AC 17 ms
11,756 KB
testcase_08 AC 17 ms
11,676 KB
testcase_09 AC 17 ms
11,856 KB
testcase_10 AC 15 ms
11,664 KB
testcase_11 AC 281 ms
15,552 KB
testcase_12 AC 905 ms
15,444 KB
testcase_13 AC 941 ms
15,536 KB
testcase_14 AC 667 ms
15,364 KB
testcase_15 AC 1,072 ms
15,572 KB
testcase_16 AC 18 ms
11,856 KB
testcase_17 AC 18 ms
11,676 KB
testcase_18 AC 19 ms
11,908 KB
testcase_19 AC 18 ms
11,748 KB
testcase_20 AC 18 ms
11,912 KB
testcase_21 AC 18 ms
11,676 KB
testcase_22 AC 18 ms
11,752 KB
testcase_23 AC 19 ms
11,864 KB
testcase_24 AC 18 ms
11,888 KB
testcase_25 AC 1,659 ms
15,428 KB
testcase_26 AC 1,483 ms
15,540 KB
testcase_27 AC 17 ms
11,872 KB
testcase_28 AC 17 ms
13,700 KB
testcase_29 AC 30 ms
13,772 KB
testcase_30 AC 1,107 ms
15,560 KB
testcase_31 AC 1,435 ms
15,532 KB
権限があれば一括ダウンロードができます

ソースコード

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