結果
| 問題 | No.643 Two Operations No.2 |
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-06 23:14:36 |
| 言語 | Common Lisp (sbcl 2.6.3) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 1,100 bytes |
| 記録 | |
| コンパイル時間 | 376 ms |
| コンパイル使用メモリ | 30,208 KB |
| 実行使用メモリ | 22,144 KB |
| 最終ジャッジ日時 | 2026-05-07 05:36:38 |
| 合計ジャッジ時間 | 1,594 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 07 MAY 2026 05:36:35 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.027
ソースコード
(defun check (x y M)
(let* ((a (first M))
(b (second M))
(c (third M))
(d (fourth M)))
(= (+ (* a x) (* b y))
(+ (* c x) (* d y)))))
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((x (read))
(y (read))
(E '(1 0 0 1))
(A '(0 1 1 0))
(B '(1 1 1 -1))
(A*B '(1 -1 1 1))
(B*A '(1 1 -1 1))
(A*B*A '(-1 1 1 1))
(B*A*B '(2 0 0 -2))
(A*B*A*B '(0 -2 2 0)))
(format t "~d~%" (cond ((check x y E)
0)
((or (check x y A)
(check x y B))
1)
((or (check x y A*B)
(check x y B*A))
2)
((or (check x y A*B*A)
(check x y B*A*B))
3)
((check x y A*B*A*B)
4)
(t
-1)))))
(main)
Common Lisp