You are viewing a single comment's thread. Return to all comments →
hi can anyone please tell me what's wrong with this code cause it's not working after test case 2 import math
import math R,n = map(int,input().split()) r = list(map(int,input().split())) dist = [] for i in range(n): if i!=n-1: d = r[i]+r[i+1] x = 2*R - d y = math.sqrt(d*d-x*x) dist.append(y) height = sum(dist)+r[0]+r[len(r)-1] print(round(height*1000))
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #222: Sphere Packing
You are viewing a single comment's thread. Return to all comments →
hi can anyone please tell me what's wrong with this code cause it's not working after test case 2 import math