Demo entry 6644600

test

   

Submitted by anonymous on Oct 05, 2017 at 03:37
Language: Python 3. Code size: 476 Bytes.

def get_sum(n):
      
      result = [0]*(n)
      comp = [1,3,4]
      for i in range(n):
            for j in comp:
                  if i - j + 1 == 0:
                        result[i] = result[i] + 1 
                  if i - j + 1 > 0:
                        result[i] = result[i] + result[i-j]
      return result[n-1]

def main():
      for i in range(5):
            size = 100000+i*10000
            print('result for',size,'is',get_sum(size)%100000)     

main()

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).