Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Counting Tiles by kurosawa4434
from math import ceil, floor, sqrt
def checkio(radius):
cr, sq = 0, 0
for n in range (ceil(radius)):
si = sqrt(radius**2 - n**2)
cr += ceil(si) * 4
if n:
sq += floor(si) * 4
return [sq, cr - sq]
July 23, 2016