Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Counting Tiles by arek.kowalski107
from math import ceil
def checkio(radius):
solid, partial = 0, 0
top = radius
bottom = radius
for i in range(1, int(radius)+1):
bottom = (radius**2-i**2)**.5
solid += int(bottom)
partial += int(ceil(top))-int(bottom)
top = bottom
if int(radius) != radius:
partial += int(ceil(bottom))
return [4*solid, 4*partial]
Dec. 14, 2016