結果

問題 No.1041 直線大学
ユーザー Common Lisp
提出日時 2024-11-07 14:45:43
言語 Common Lisp
(sbcl 2.5.0)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 669 bytes
コンパイル時間 1,224 ms
コンパイル使用メモリ 34,988 KB
実行使用メモリ 31,892 KB
最終ジャッジ日時 2024-11-07 14:45:49
合計ジャッジ時間 3,015 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 07 NOV 2024 02:45:46 PM):

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

ソースコード

diff #

(defun main (&rest argv)
  (declare (ignorable argv))
  (let* ((n (read))
         (x (make-array n :element-type 'integer))
         (y (make-array n :element-type 'integer))
         (res 0))
    (dotimes (i n)
      (setf (aref x i) (read)
            (aref y i) (read)))
    (dotimes (i n)
      (dotimes (j i)
        (let ((a 0))
          (dotimes (k n)
            (incf a (if (zerop (- (* (- (aref x k) (aref x j)) (- (aref y i) (aref y j)))
                                  (* (- (aref x i) (aref x j)) (- (aref y k) (aref y j)))))
                        1
                        0)))
          (setq res (max res a)))))
    (format t "~d~%" res)))

(main)
0