##AWK, 90 bytes
AWK, 90 bytes
{z=1ドル*1ドル
for(x=1ドル;x>=0;x--)for(y=0;y<=1ドル;y++){d=z-x*x-y*y
if(d>0&&d<2*(x+y)+2)c++}0ドル=4*c}1
Usage:
awk '{z=1ドル*1ドル
for(x=1ドル;x>=0;x--)for(y=0;y<=1ドル;y++){d=z-x*x-y*y
if(d>0&&d<2*(x+y)+2)c++}0ドル=4*c}1' <<< 5525
Just a simple search through quadrant 1 to find all boxes that will intersect the circle. Symmetry allows for the multiply by 4. Could go from -1ドル to 1ドル, but that would take a more bytes and be less efficient. Obviously this is not the most time efficient of algorithms, but it only takes about 16 seconds to run the 5525 case on my machine.
##AWK, 90 bytes
{z=1ドル*1ドル
for(x=1ドル;x>=0;x--)for(y=0;y<=1ドル;y++){d=z-x*x-y*y
if(d>0&&d<2*(x+y)+2)c++}0ドル=4*c}1
Usage:
awk '{z=1ドル*1ドル
for(x=1ドル;x>=0;x--)for(y=0;y<=1ドル;y++){d=z-x*x-y*y
if(d>0&&d<2*(x+y)+2)c++}0ドル=4*c}1' <<< 5525
Just a simple search through quadrant 1 to find all boxes that will intersect the circle. Symmetry allows for the multiply by 4. Could go from -1ドル to 1ドル, but that would take a more bytes and be less efficient. Obviously this is not the most time efficient of algorithms, but it only takes about 16 seconds to run the 5525 case on my machine.
AWK, 90 bytes
{z=1ドル*1ドル
for(x=1ドル;x>=0;x--)for(y=0;y<=1ドル;y++){d=z-x*x-y*y
if(d>0&&d<2*(x+y)+2)c++}0ドル=4*c}1
Usage:
awk '{z=1ドル*1ドル
for(x=1ドル;x>=0;x--)for(y=0;y<=1ドル;y++){d=z-x*x-y*y
if(d>0&&d<2*(x+y)+2)c++}0ドル=4*c}1' <<< 5525
Just a simple search through quadrant 1 to find all boxes that will intersect the circle. Symmetry allows for the multiply by 4. Could go from -1ドル to 1ドル, but that would take a more bytes and be less efficient. Obviously this is not the most time efficient of algorithms, but it only takes about 16 seconds to run the 5525 case on my machine.
##AWK, 90 bytes
{z=1ドル*1ドル
for(x=1ドル;x>=0;x--)for(y=0;y<=1ドル;y++){d=z-x*x-y*y
if(d>0&&d<2*(x+y)+2)c++}0ドル=4*c}1
Usage:
awk '{z=1ドル*1ドル
for(x=1ドル;x>=0;x--)for(y=0;y<=1ドル;y++){d=z-x*x-y*y
if(d>0&&d<2*(x+y)+2)c++}0ドル=4*c}1' <<< 5525
Just a simple search through quadrant 1 to find all boxes that will intersect the circle. Symmetry allows for the multiply by 4. Could go from -1ドル to 1ドル, but that would take a more bytes and be less efficient. Obviously this is not the most time efficient of algorithms, but it only takes about 16 seconds to run the 5525 case on my machine.