結果

問題 No.1064 ∪∩∩ / Cup Cap Cap
ユーザー Common LispCommon Lisp
提出日時 2024-11-11 12:56:42
言語 Common Lisp
(sbcl 2.5.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 791 bytes
コンパイル時間 1,909 ms
コンパイル使用メモリ 34,740 KB
実行使用メモリ 22,144 KB
最終ジャッジ日時 2024-11-11 12:56:47
合計ジャッジ時間 2,823 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 36
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 11 NOV 2024 12:56:43 PM):

; wrote /home/judge/data/code/Main.fasl
; compilation finished in 0:00:00.041

ソースコード

diff #

(defun main (&rest argv)
  (declare (ignorable argv))
  (let* ((a (read))
         (b (read))
         (c (read))
         (d (read))
         (D (- (* (- a c) (- a c)) (* 8 (- b d)))))
    (cond ((minusp D) (format t "No~%"))
          ((zerop D) (format t "Yes~%"))
          (t
            (let* ((p (float a 0d0))
                   (q (float b 0d0))
                   (r (float c 0d0))
                  ;(s (float d 0d0))
                   (x1 (/ (- r p (sqrt (float D 0d0))) 4d0))
                   (x2 (/ (+ r (- p) (sqrt (float D 0d0))) 4d0))
                   (y1 (+ (* x1 x1) (* p x1) q))
                   (y2 (+ (* x2 x2) (* p x2) q))
                   (n (/ (- y2 y1) (- x2 x1)))
                   (m (- y1 (* n x1))))
              (format t "~f ~f~%" n m))))))

(main)
0