rishipunna's blog

By rishipunna, history, 4 years ago, In English

I'm getting a Runtime Error when I submitted the code:

import itertools
import numpy as np
n=int(input())
for i in range(n):
	m=int(input())
	x=list(map(int,input().split()))
	minn=None
	for comb in itertools.combinations(x, 5):
		r=np.prod(comb)
		if minn==None:
			minn=r
		elif r>minn:
			minn=r
	print(minn)

for the problem https://codeforces.net/contest/1406/problem/B.

Please help me out with this!

  • Vote: I like it
  • -1
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it +7 Vote: I do not like it

I believe Codeforces does not have numpy installed for Python. If you run import numpy on Custom Invocation in Python 3 it will crash.