結果
| 問題 | No.406 鴨等間隔の法則 |
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-10-09 18:34:20 |
| 言語 | Common Lisp (sbcl 2.6.7) |
| 結果 |
AC
不安定
|
| 実行時間 | 58 ms / 2,000 ms |
| + 420µs | |
| コード長 | 451 bytes |
| 記録 | |
| コンパイル時間 | 359 ms |
| コンパイル使用メモリ | 27,904 KB |
| 実行使用メモリ | 21,248 KB |
| 最終ジャッジ日時 | 2026-09-12 19:03:00 |
| 合計ジャッジ時間 | 3,582 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 12 SEP 2026 07:02:56 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.193
ソースコード
; ソートして 3 項ずつ等差数列になっているかチェックし
; 全て等差数列になっていれば YES それ以外は NO を出力
(defun main ()
(let* ((n (read))
(xs (sort (loop repeat n collect (read)) #'<)))
(princ (if (loop for (x1 x2 x3) on xs
while x3
always (and (= (- x2 x1) (- x3 x2)) (/= x2 x1)))
"YES"
"NO"))
(terpri)))
(main)
Common Lisp