結果
| 問題 | No.887 Collatz |
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-06 01:27:52 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 2,000 ms |
| コード長 | 336 bytes |
| 記録 | |
| コンパイル時間 | 371 ms |
| コンパイル使用メモリ | 35,380 KB |
| 実行使用メモリ | 32,020 KB |
| 最終ジャッジ日時 | 2024-11-06 01:27:55 |
| 合計ジャッジ時間 | 2,153 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 06 NOV 2024 01:27:52 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.007
ソースコード
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((n (read))
(a 0)
(b n))
(loop while (/= n 1)
if (oddp n)
do (setq n (1+ (* 3 n)))
(setq b (max b n))
else
do (setq n (floor n 2))
do (incf a))
(format t "~d~%~d~%" a b)))
(main)
Common Lisp