xerox38's blog

By xerox38, history, 2 months ago, In English,

from numpy import *

n = int(input())

b = list(map(int,input().strip().split()))[:n]

c=array(b)

d=[]

for i in range(n):

d.append(sum(c[0:i+1]))

print(d)

. here showing run time error. but why? any solution?

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Your code causes this error message:

Error Message

I think numpy is not available in codeforces.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    any solution?

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Actually, I haven't used Python for a long time. But as far as I know, you have to use something other than NumPy.