Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Short O(n) solution in Creative category for Counting Tiles by StefanPochmann
from math import *
def checkio(radius):
y = [max(0, radius**2 - x**2) ** 0.5 for x in range(ceil(radius))]
all = 4 * sum(map(ceil, y))
solid = 4 * sum(map(floor, y[1:]))
return [solid, all-solid]
April 24, 2015