Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Speedy category for Counting Tiles by rkosyk
from math import sqrt, ceil
def checkio(radius):
N = [sqrt(radius*radius-i*i) for i in range(int(radius+1))]
solid = sum([int(i) for i in N[1:]])
partial = sum([ceil(N[i]-int(N[i+1])) for (i,j) in enumerate(N[:-1])]) + ceil(N[-1])
return [solid*4, partial*4]
Jan. 21, 2016