結果
| 問題 |
No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
|
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-04 21:47:24 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 2,000 ms |
| コード長 | 434 bytes |
| コンパイル時間 | 218 ms |
| コンパイル使用メモリ | 33,516 KB |
| 実行使用メモリ | 30,012 KB |
| 最終ジャッジ日時 | 2024-11-04 21:47:26 |
| 合計ジャッジ時間 | 1,820 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 04 NOV 2024 09:47:24 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.007
ソースコード
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((n (read))
(k (read)))
(format t "~d~%" (cond ((or (<= k 0) (> k n))
0)
((evenp n)
(- n 2))
(t
(if (= k (floor (1+ n) 2))
(- n 1)
(- n 2)))))))
(main)
Common Lisp