Submission #2408191
Source Code Expand
(defun take (l n) (if (or (null l) (= n 0)) '() (cons (car l) (take (cdr l) (1- n))))) (defun far-the-most-dot (list) (let* ((l (reverse list)) (l-size (length list)) (pos (position #\. l))) (when pos (- (1- l-size) pos)))) (defun far-the-most-x (list) (let* ((l (reverse list)) (l-size (length list)) (pos (position #\X l))) (when pos (- (1- l-size) pos)))) (defun calc-next-pos (list) (or (far-the-most-dot list) (far-the-most-x list))) (defun calc-step-positions (list start-pos) (if (< (length list) 5) '() (let* ((l (take (cdr list) 3)) (next-pos (+ (calc-next-pos l) 1 start-pos))) (cons next-pos (calc-step-positions (subseq list next-pos) next-pos))))) (let* ((_ (read)) (s (concatenate 'list (string-right-trim '(#\Newline) (read-line)))) (step-positions (calc-step-positions s 0)) (x-num (count-if (lambda (idx) (equal (nth idx s) #\X)) step-positions))) (format 't "~A~%" x-num))
Submission Info
Submission Time | |
---|---|
Task | B - 雨上がり |
User | toku345 |
Language | Common Lisp (SBCL 1.1.14) |
Score | 0 |
Code Size | 1090 Byte |
Status | RE |
Exec Time | 121 ms |
Memory | 57956 KB |
Judge Result
Set Name | All | ||||||
---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 50 | ||||||
Status |
|
Set Name | Test Cases |
---|---|
All | case_000.txt, case_001.txt, case_002.txt, case_003.txt, case_004.txt, case_005.txt, case_006.txt, case_007.txt, case_008.txt, case_009.txt, case_010.txt, case_011.txt, case_012.txt, case_013.txt, case_014.txt, case_015.txt, case_016.txt, case_017.txt, case_018.txt, case_019.txt, case_020.txt, case_021.txt, case_022.txt, case_023.txt, case_024.txt, case_025.txt, case_026.txt, case_027.txt, case_028.txt, case_029.txt, case_030.txt, case_031.txt, case_032.txt, case_033.txt, case_034.txt, case_035.txt, case_036.txt, case_037.txt, case_038.txt, case_039.txt, case_040.txt, case_041.txt, case_042.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
case_000.txt | AC | 20 ms | 6496 KB |
case_001.txt | WA | 20 ms | 6504 KB |
case_002.txt | AC | 20 ms | 6500 KB |
case_003.txt | AC | 20 ms | 6496 KB |
case_004.txt | AC | 20 ms | 6496 KB |
case_005.txt | AC | 20 ms | 6496 KB |
case_006.txt | AC | 20 ms | 6504 KB |
case_007.txt | AC | 19 ms | 6500 KB |
case_008.txt | RE | 47 ms | 10336 KB |
case_009.txt | WA | 20 ms | 6496 KB |
case_010.txt | RE | 121 ms | 57956 KB |
case_011.txt | RE | 60 ms | 20964 KB |
case_012.txt | WA | 20 ms | 6500 KB |
case_013.txt | RE | 67 ms | 31200 KB |
case_014.txt | WA | 20 ms | 6500 KB |
case_015.txt | WA | 19 ms | 6504 KB |
case_016.txt | RE | 92 ms | 43492 KB |
case_017.txt | WA | 20 ms | 6500 KB |
case_018.txt | RE | 93 ms | 45540 KB |
case_019.txt | RE | 61 ms | 23012 KB |
case_020.txt | WA | 20 ms | 6500 KB |
case_021.txt | AC | 19 ms | 6500 KB |
case_022.txt | RE | 96 ms | 45536 KB |
case_023.txt | AC | 20 ms | 6500 KB |
case_024.txt | RE | 105 ms | 53736 KB |
case_025.txt | RE | 64 ms | 29156 KB |
case_026.txt | RE | 47 ms | 16872 KB |
case_027.txt | RE | 73 ms | 33252 KB |
case_028.txt | RE | 47 ms | 16864 KB |
case_029.txt | RE | 54 ms | 18916 KB |
case_030.txt | RE | 93 ms | 45540 KB |
case_031.txt | WA | 20 ms | 6496 KB |
case_032.txt | WA | 20 ms | 6500 KB |
case_033.txt | RE | 62 ms | 27108 KB |
case_034.txt | WA | 20 ms | 6500 KB |
case_035.txt | RE | 58 ms | 20968 KB |
case_036.txt | RE | 90 ms | 43492 KB |
case_037.txt | RE | 58 ms | 20964 KB |
case_038.txt | RE | 63 ms | 29160 KB |
case_039.txt | RE | 56 ms | 25064 KB |
case_040.txt | WA | 20 ms | 6504 KB |
case_041.txt | RE | 66 ms | 27112 KB |
case_042.txt | RE | 107 ms | 53732 KB |