結果
問題 |
No.607 開通777年記念
|
ユーザー |
![]() |
提出日時 | 2024-11-13 13:45:08 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
AC
|
実行時間 | 383 ms / 2,000 ms |
コード長 | 826 bytes |
コンパイル時間 | 553 ms |
コンパイル使用メモリ | 28,288 KB |
実行使用メモリ | 21,888 KB |
最終ジャッジ日時 | 2024-11-13 13:45:11 |
合計ジャッジ時間 | 3,062 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 13 NOV 2024 01:45:08 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.039
ソースコード
(defun main (&rest argv) (declare (ignorable argv)) (let* ((*read-default-float-format* 'double-float) (n (read)) (m (read)) (a (make-array 1111 :element-type 'integer :initial-element 0)) (b (make-array 1111 :element-type 'integer :initial-element 0))) (dotimes (_ m) (dotimes (i n) (setf (aref b i) (read))) (dotimes (i n) (incf (aref a i) (aref b i))) (let ((l 0) (r 0) (s 0)) (loop while (< l n) do (loop while (and (< r n) (< s 777)) do (incf s (aref a r)) (incf r)) (when (= s 777) (format t "YES~%") (return-from main 0)) (decf s (aref a l)) (incf l)))) (format t "NO~%")) 0) (main)