結果
問題 | No.216 FAC |
ユーザー |
|
提出日時 | 2025-04-11 22:02:17 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
AC
|
実行時間 | 8 ms / 1,000 ms |
コード長 | 707 bytes |
コンパイル時間 | 2,005 ms |
コンパイル使用メモリ | 34,988 KB |
実行使用メモリ | 25,668 KB |
最終ジャッジ日時 | 2025-04-11 22:02:20 |
合計ジャッジ時間 | 1,422 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 11 APR 2025 10:02:17 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.085
ソースコード
(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 101 :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 1 to 100 do (if (< nokori (aref sum i)) (progn (format t "NO~%") (quit)))) (format t "YES~%")