結果
| 問題 |
No.358 も~っと!門松列
|
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-07 19:30:29 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 1,000 ms |
| コード長 | 669 bytes |
| コンパイル時間 | 1,528 ms |
| コンパイル使用メモリ | 27,136 KB |
| 実行使用メモリ | 21,760 KB |
| 最終ジャッジ日時 | 2024-11-07 19:30:32 |
| 合計ジャッジ時間 | 2,205 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 07 NOV 2024 07:30:29 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.034
ソースコード
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((a (read))
(b (read))
(c (read)))
(cond ((or (= a b) (= b c) (= c a))
(format t "0~%"))
((or (and (< b a) (< b c)) (and (> b a) (> b c)))
(format t "INF~%"))
(t
(let ((ans 0))
(loop for i from 2 to (max a c) do
(let ((p (mod a i))
(q (mod b i))
(r (mod c i)))
(when (and (/= p r) (or (and (< q p) (< q r)) (and (> q p) (> q r))))
(incf ans))))
(format t "~d~%" ans))))))
(main)
Common Lisp