結果

問題 No.388 階段 (1)
ユーザー φλμφλμ
提出日時 2018-05-29 20:30:00
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 473 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 11,872 KB
最終ジャッジ日時 2023-09-12 20:27:22
合計ジャッジ時間 1,234 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
11,844 KB
testcase_01 AC 19 ms
11,644 KB
testcase_02 AC 18 ms
11,656 KB
testcase_03 AC 19 ms
11,740 KB
testcase_04 AC 20 ms
11,680 KB
testcase_05 AC 20 ms
11,672 KB
testcase_06 AC 18 ms
11,724 KB
testcase_07 AC 19 ms
11,868 KB
testcase_08 AC 20 ms
11,680 KB
testcase_09 AC 19 ms
11,580 KB
testcase_10 AC 18 ms
11,796 KB
testcase_11 AC 19 ms
11,872 KB
testcase_12 AC 19 ms
11,840 KB
testcase_13 AC 20 ms
11,656 KB
testcase_14 AC 19 ms
11,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

;;; no.388 階段(1)
;;;
;;; Fが整数という条件なので、一階層分の高さは階段1段の高さで割り切れるようです。
;;; S=0〜(F-1) -> 1階、S=F〜(2F-1) -> 2階、、、、、

(define steps_1
  (lambda ()
    (let ((S (read)) (F (read))
          )

      (let loop ((flr 1) (nF F))
        (cond ((< S nF)
               (print flr)
               )
              ((>= S nF)
               (loop (+ 1 flr) (+ nF F)))))
      )))

(steps_1)
0