結果

問題 No.642 Two Operations No.1
ユーザー n_getn_get
提出日時 2022-07-04 13:54:48
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 157 bytes
コンパイル時間 50 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 11,836 KB
最終ジャッジ日時 2023-08-20 20:44:14
合計ジャッジ時間 1,506 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
11,676 KB
testcase_01 AC 15 ms
11,660 KB
testcase_02 AC 15 ms
11,760 KB
testcase_03 AC 15 ms
11,608 KB
testcase_04 AC 15 ms
11,780 KB
testcase_05 AC 14 ms
11,608 KB
testcase_06 AC 14 ms
11,744 KB
testcase_07 AC 14 ms
11,660 KB
testcase_08 AC 14 ms
11,808 KB
testcase_09 AC 15 ms
11,836 KB
testcase_10 AC 14 ms
11,676 KB
testcase_11 AC 15 ms
11,604 KB
testcase_12 AC 14 ms
11,644 KB
testcase_13 AC 15 ms
11,672 KB
testcase_14 AC 15 ms
11,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(let loop[[n (read)][sum 0]]
     (cond [(= n 1) (print sum)]
           [(odd? n) (loop (+ n 1) (+ sum 1))]
           [else (loop (ash n -1) (+ sum 1))]))
0