結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー MiyamonYMiyamonY
提出日時 2019-09-06 14:22:16
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 176 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 13,860 KB
最終ジャッジ日時 2023-09-06 02:40:42
合計ジャッジ時間 1,655 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
11,720 KB
testcase_01 AC 17 ms
11,676 KB
testcase_02 AC 17 ms
11,652 KB
testcase_03 AC 17 ms
11,640 KB
testcase_04 AC 16 ms
11,688 KB
testcase_05 AC 17 ms
11,672 KB
testcase_06 AC 17 ms
11,664 KB
testcase_07 AC 17 ms
11,664 KB
testcase_08 AC 17 ms
11,872 KB
testcase_09 AC 18 ms
11,720 KB
testcase_10 AC 18 ms
11,648 KB
testcase_11 AC 17 ms
11,652 KB
testcase_12 AC 18 ms
13,860 KB
testcase_13 AC 17 ms
11,728 KB
testcase_14 AC 17 ms
11,724 KB
testcase_15 AC 17 ms
11,888 KB
testcase_16 AC 16 ms
11,852 KB
testcase_17 AC 16 ms
11,724 KB
testcase_18 AC 17 ms
11,732 KB
testcase_19 AC 17 ms
11,864 KB
testcase_20 AC 17 ms
11,684 KB
testcase_21 AC 17 ms
11,664 KB
testcase_22 AC 17 ms
11,652 KB
testcase_23 AC 17 ms
11,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(let* ((n (string->number (read-line))))

  (print (if (= n 1)
	     0
	     (+ 1 (let loop ((i 0)
			     (m 1))
		    (if (<= n (* 2 m))
			i
			(loop (+ i 1) (* 2 m))))))))
0