結果
問題 | No.179 塗り分け |
ユーザー | Common Lisp |
提出日時 | 2024-11-09 02:38:24 |
言語 | Common Lisp (sbcl 2.3.8) |
結果 |
AC
|
実行時間 | 349 ms / 3,000 ms |
コード長 | 1,528 bytes |
コンパイル時間 | 1,337 ms |
コンパイル使用メモリ | 31,360 KB |
実行使用メモリ | 87,936 KB |
最終ジャッジ日時 | 2024-11-09 02:38:32 |
合計ジャッジ時間 | 6,382 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 11 ms
24,704 KB |
testcase_01 | AC | 9 ms
21,888 KB |
testcase_02 | AC | 14 ms
28,928 KB |
testcase_03 | AC | 14 ms
28,032 KB |
testcase_04 | AC | 17 ms
32,256 KB |
testcase_05 | AC | 9 ms
21,760 KB |
testcase_06 | AC | 62 ms
82,176 KB |
testcase_07 | AC | 9 ms
21,888 KB |
testcase_08 | AC | 242 ms
87,808 KB |
testcase_09 | AC | 21 ms
38,144 KB |
testcase_10 | AC | 144 ms
86,784 KB |
testcase_11 | AC | 142 ms
86,912 KB |
testcase_12 | AC | 235 ms
87,552 KB |
testcase_13 | AC | 39 ms
62,464 KB |
testcase_14 | AC | 28 ms
46,208 KB |
testcase_15 | AC | 10 ms
21,888 KB |
testcase_16 | AC | 10 ms
22,528 KB |
testcase_17 | AC | 10 ms
21,888 KB |
testcase_18 | AC | 148 ms
86,784 KB |
testcase_19 | AC | 140 ms
86,784 KB |
testcase_20 | AC | 9 ms
21,760 KB |
testcase_21 | AC | 9 ms
21,760 KB |
testcase_22 | AC | 349 ms
87,936 KB |
testcase_23 | AC | 146 ms
86,784 KB |
testcase_24 | AC | 257 ms
87,808 KB |
testcase_25 | AC | 193 ms
87,168 KB |
testcase_26 | AC | 106 ms
86,272 KB |
testcase_27 | AC | 250 ms
87,808 KB |
testcase_28 | AC | 101 ms
86,400 KB |
testcase_29 | AC | 275 ms
87,808 KB |
testcase_30 | AC | 125 ms
86,400 KB |
testcase_31 | AC | 250 ms
87,936 KB |
testcase_32 | AC | 186 ms
87,040 KB |
testcase_33 | AC | 250 ms
87,936 KB |
testcase_34 | AC | 150 ms
86,784 KB |
testcase_35 | AC | 277 ms
87,936 KB |
testcase_36 | AC | 13 ms
26,624 KB |
testcase_37 | AC | 9 ms
21,760 KB |
testcase_38 | AC | 14 ms
28,160 KB |
testcase_39 | AC | 16 ms
30,336 KB |
testcase_40 | AC | 19 ms
35,072 KB |
testcase_41 | AC | 9 ms
21,888 KB |
testcase_42 | AC | 20 ms
36,480 KB |
testcase_43 | AC | 66 ms
84,736 KB |
testcase_44 | AC | 111 ms
86,656 KB |
testcase_45 | AC | 45 ms
70,400 KB |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 09 NOV 2024 02:38:24 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.047
ソースコード
(defun check (x y h w s) (let ((ss (make-array (list 101 101) :initial-element nil))) (dotimes (yy h) (dotimes (xx w) (unless (or (char= #\. (char (aref s yy) xx)) (aref ss yy xx)) (setf (aref ss yy xx) t) (let ((yyy (+ yy y)) (xxx (+ xx x))) (when (or (< yyy 0) (>= yyy h) (< xxx 0) (>= xxx w)) (return-from check nil)) (if (and (char= #\# (char (aref s yyy) xxx)) (not (aref ss yyy xxx))) (setf (aref ss yyy xxx) t) (return-from check nil)))))) (dotimes (yy h) (dotimes (xx w) (when (and (char= #\# (char (aref s yy) xx)) (not (aref ss yy xx))) (return-from check nil)))) t)) (defun main (&rest argv) (declare (ignorable argv)) (let* ((h (read)) (w (read)) (sharp-count 0) (s (make-array h :element-type 'string))) (dotimes (i h) (setf (aref s i) (read-line)) (dotimes (j w) (when (char= #\# (char (aref s i) j)) (incf sharp-count)))) (when (or (oddp sharp-count) (zerop sharp-count)) (format t "NO~%") (return-from main)) (loop for x from (- w) to w do (loop for y from (- h) to h when (check x y h w s) do (format t "YES~%") (return-from main))) (format t "NO~%"))) (main)