Submission #172529


Source Code Expand

Copy
(define N (read))

(define (readnums N)
  (define (readnums-r l i)
    (if (< 0 i)
        (readnums-r (cons (read) l) (- i 1))
        l))
  (readnums-r '() N))

(define list (readnums N))

(define (get-result list)
  (define (s list left num res)
    (define (f left right num)
      (define (lp left right num res)
        (if (< left right)
            res
            (lp (- left 1) right num (+ res (f left right (- num 1))))))
      (if (= num 1)
          (+ 1 (- left right))
          (lp left right num 0)))
          
    (cond 
      ((null? list) res)
      ((= (car list) -1) (s (cdr list) left (+ num 1) res))
      ((not (= num 0)) (s (cdr list) (car list) 0 (* res (f left (car list) num))))
      (else (s (cdr list) (car list) 0 res))))
  (s list (car list) 0 1))


(display (modulo (get-result list) 1000000007))
(display "\n")

Submission Info

Submission Time
Task C - タコヤ木
User NKudryavka
Language Scheme (Scheme 9.1)
Score 0
Code Size 879 Byte
Status TLE
Exec Time 2032 ms
Memory 46004 KB

Judge Result

Set Name Sample Subtask1 Subtask2 Subtask3
Score / Max Score 0 / 0 0 / 50 0 / 30 0 / 20
Status
AC × 2
TLE × 1
AC × 13
TLE × 1
AC × 22
TLE × 4
AC × 24
TLE × 12
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
Subtask1 sample_01.txt, sample_02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt
Subtask2 sample_01.txt, sample_02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt
Subtask3 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask3_01.txt, subtask3_02.txt, subtask3_03.txt, subtask3_04.txt, subtask3_05.txt, subtask3_06.txt, subtask3_07.txt, subtask3_08.txt, subtask3_09.txt, subtask3_10.txt, subtask3_11.txt, subtask3_12.txt
Case Name Status Exec Time Memory
sample_01.txt AC 399 ms 29396 KB
sample_02.txt AC 207 ms 29400 KB
sample_03.txt TLE 2031 ms 45752 KB
subtask1_01.txt AC 211 ms 29396 KB
subtask1_02.txt AC 211 ms 29396 KB
subtask1_03.txt AC 207 ms 29400 KB
subtask1_04.txt AC 213 ms 29472 KB
subtask1_05.txt AC 232 ms 29584 KB
subtask1_06.txt AC 211 ms 29492 KB
subtask1_07.txt TLE 2031 ms 45748 KB
subtask1_08.txt AC 220 ms 29480 KB
subtask1_09.txt AC 208 ms 29492 KB
subtask1_10.txt AC 209 ms 29612 KB
subtask1_11.txt AC 216 ms 29492 KB
subtask1_12.txt AC 258 ms 30644 KB
subtask2_01.txt AC 206 ms 29392 KB
subtask2_02.txt AC 207 ms 29400 KB
subtask2_03.txt AC 212 ms 29492 KB
subtask2_04.txt AC 225 ms 30000 KB
subtask2_05.txt AC 255 ms 31136 KB
subtask2_06.txt TLE 2031 ms 45736 KB
subtask2_07.txt TLE 2031 ms 46004 KB
subtask2_08.txt AC 312 ms 31908 KB
subtask2_09.txt AC 273 ms 31912 KB
subtask2_10.txt TLE 2032 ms 45748 KB
subtask2_11.txt AC 278 ms 31920 KB
subtask2_12.txt AC 277 ms 32052 KB
subtask3_01.txt AC 207 ms 29400 KB
subtask3_02.txt AC 206 ms 29396 KB
subtask3_03.txt TLE 2030 ms 45768 KB
subtask3_04.txt TLE 2032 ms 45748 KB
subtask3_05.txt TLE 2032 ms 45760 KB
subtask3_06.txt TLE 2032 ms 45772 KB
subtask3_07.txt TLE 2031 ms 46004 KB
subtask3_08.txt AC 304 ms 32564 KB
subtask3_09.txt AC 277 ms 32084 KB
subtask3_10.txt TLE 2032 ms 45748 KB
subtask3_11.txt TLE 2032 ms 45748 KB
subtask3_12.txt TLE 2032 ms 45792 KB