Submission #172537


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 (modulo (* res (f left (car list) num)) 1000000007)))
      (else (s (cdr list) (car list) 0 res))))
  (s list (car list) 0 1))


(display (get-result list))
(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 2050 ms
Memory 46268 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 559 ms 29628 KB
sample_02.txt AC 220 ms 29600 KB
sample_03.txt TLE 2047 ms 45996 KB
subtask1_01.txt AC 219 ms 29620 KB
subtask1_02.txt AC 217 ms 29620 KB
subtask1_03.txt AC 223 ms 29688 KB
subtask1_04.txt AC 225 ms 29720 KB
subtask1_05.txt AC 218 ms 29836 KB
subtask1_06.txt AC 217 ms 29788 KB
subtask1_07.txt TLE 2044 ms 45952 KB
subtask1_08.txt AC 220 ms 29716 KB
subtask1_09.txt AC 219 ms 29716 KB
subtask1_10.txt AC 222 ms 29788 KB
subtask1_11.txt AC 231 ms 29780 KB
subtask1_12.txt AC 275 ms 30932 KB
subtask2_01.txt AC 223 ms 29628 KB
subtask2_02.txt AC 214 ms 29624 KB
subtask2_03.txt AC 231 ms 29720 KB
subtask2_04.txt AC 238 ms 30420 KB
subtask2_05.txt AC 272 ms 31380 KB
subtask2_06.txt TLE 2047 ms 45916 KB
subtask2_07.txt TLE 2047 ms 46216 KB
subtask2_08.txt AC 297 ms 32156 KB
subtask2_09.txt AC 357 ms 32276 KB
subtask2_10.txt TLE 2047 ms 45948 KB
subtask2_11.txt AC 312 ms 32156 KB
subtask2_12.txt AC 293 ms 32340 KB
subtask3_01.txt AC 248 ms 29604 KB
subtask3_02.txt AC 253 ms 29608 KB
subtask3_03.txt TLE 2045 ms 45980 KB
subtask3_04.txt TLE 2047 ms 46064 KB
subtask3_05.txt TLE 2045 ms 45980 KB
subtask3_06.txt TLE 2045 ms 45972 KB
subtask3_07.txt TLE 2046 ms 46268 KB
subtask3_08.txt AC 316 ms 32792 KB
subtask3_09.txt AC 291 ms 32256 KB
subtask3_10.txt TLE 2047 ms 46172 KB
subtask3_11.txt TLE 2045 ms 46052 KB
subtask3_12.txt TLE 2050 ms 46084 KB