結果
| 問題 | No.216 FAC |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-11 21:57:34 |
| 言語 | Common Lisp (sbcl 2.6.3) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 712 bytes |
| 記録 | |
| コンパイル時間 | 989 ms |
| コンパイル使用メモリ | 34,116 KB |
| 実行使用メモリ | 30,580 KB |
| 最終ジャッジ日時 | 2026-07-08 16:09:55 |
| 合計ジャッジ時間 | 2,605 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 1 RE * 11 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 08 JUL 2026 04:09:52 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.049
ソースコード
(defvar N)
(defvar a)
(defvar b)
(setq N (parse-integer (read-line)))
(setq a (read-from-string (concatenate 'string "(" (read-line) ")")))
(setq b (read-from-string (concatenate 'string "(" (read-line) ")")))
;(print N)
;(print a)
;(print b)
(defvar sum)
(defvar nokori)
(defvar sum (make-array 100 :initial-element 0))
(defvar nokori 0)
(loop for i from 0 to (- N 1) do
(if (= (nth i b) 0) (setq nokori (+ nokori (nth i a)))
(setf (aref sum (nth i b)) (+ (aref sum (nth i b)) (nth i a))))
(values)
)
;(print sum)
;(print nokori)
;(format t "~a~%" (if (>= nokori (max sum)) "YES" "NO"))
(loop for i from 0 to (- N 1) do
(if (< nokori (aref sum i)) (progn (format t "NO~%") (quit))))
(format t "YES~%")