Smallest Integer Disk
Clash Royale CLAN TAG#URR8PPP
up vote
6
down vote
favorite
This challenge is about finding the smallest disk that contains some given points. This is made somewhat trickier, however, by the fact that in this challenge, the disk's coordinates and radius must both be integers.
Your input will be a list of points with integer coordinates x
and y
. You can take this as a list of tuples, a list of lists, or any other way to represent a collection of pairs. x
and y
will both be (possibly negative) integers. Every point is guaranteed to be unique, and there will be at least one point.
Your output will be a disk in the form of three numbers, X
, Y
, and R
. X
, Y
, and R
are all integers, X
and Y
represent the disk's center and R
represents its radius. The distance between every given point and the center must be less than or equal to R
, and there must not exist such a disk with a smaller R
that also satisfies this condition.
It is possible that there will be multiple possible solutions for a given input, your code must output at least one of them in this case.
You can use any kinds of geometry builtins your language supports if there are any, and input/output may be through built-in point/disk objects instead of just numbers.
Test Cases
Input (Possible) Output(s)
(x,y) (X,Y,R)
-------------------------
(0,0) (0,0,0)
-------------------------
(0,1) (0,0,1)
(1,0) (1,1,1)
-------------------------
(1,4) (4,4,3)
(3,2)
(4,1)
(4,5)
(5,2)
(7,4)
-------------------------
(-1,0) (0,0,2)
(2,0) (1,0,2)
-------------------------
(-1,0) (1,0,2)
(2,1) (0,1,2)
Fewest bytes wins.
code-golf geometry
 |Â
show 1 more comment
up vote
6
down vote
favorite
This challenge is about finding the smallest disk that contains some given points. This is made somewhat trickier, however, by the fact that in this challenge, the disk's coordinates and radius must both be integers.
Your input will be a list of points with integer coordinates x
and y
. You can take this as a list of tuples, a list of lists, or any other way to represent a collection of pairs. x
and y
will both be (possibly negative) integers. Every point is guaranteed to be unique, and there will be at least one point.
Your output will be a disk in the form of three numbers, X
, Y
, and R
. X
, Y
, and R
are all integers, X
and Y
represent the disk's center and R
represents its radius. The distance between every given point and the center must be less than or equal to R
, and there must not exist such a disk with a smaller R
that also satisfies this condition.
It is possible that there will be multiple possible solutions for a given input, your code must output at least one of them in this case.
You can use any kinds of geometry builtins your language supports if there are any, and input/output may be through built-in point/disk objects instead of just numbers.
Test Cases
Input (Possible) Output(s)
(x,y) (X,Y,R)
-------------------------
(0,0) (0,0,0)
-------------------------
(0,1) (0,0,1)
(1,0) (1,1,1)
-------------------------
(1,4) (4,4,3)
(3,2)
(4,1)
(4,5)
(5,2)
(7,4)
-------------------------
(-1,0) (0,0,2)
(2,0) (1,0,2)
-------------------------
(-1,0) (1,0,2)
(2,1) (0,1,2)
Fewest bytes wins.
code-golf geometry
Sandbox
â Pavel
2 hours ago
Found a couple typos, if you don't mind me pointing them out: "This is made somewhat trickier..."; "...represents the disk's center and R represents its radius..."; "...and there must not exist such a disk..."
â J. Sallé
2 hours ago
2
Usually making things integer just make code-golf easier.
â user202729
2 hours ago
@KevinCruijssen That's by coincidence. Inputs can be in any order.
â Pavel
1 hour ago
@Pavel The input can be in any order, or we can take the input in any order? As in, the input can be in any order and we should manually sort first in our solution, or can we already take the input pre-sorted?
â Kevin Cruijssen
1 hour ago
 |Â
show 1 more comment
up vote
6
down vote
favorite
up vote
6
down vote
favorite
This challenge is about finding the smallest disk that contains some given points. This is made somewhat trickier, however, by the fact that in this challenge, the disk's coordinates and radius must both be integers.
Your input will be a list of points with integer coordinates x
and y
. You can take this as a list of tuples, a list of lists, or any other way to represent a collection of pairs. x
and y
will both be (possibly negative) integers. Every point is guaranteed to be unique, and there will be at least one point.
Your output will be a disk in the form of three numbers, X
, Y
, and R
. X
, Y
, and R
are all integers, X
and Y
represent the disk's center and R
represents its radius. The distance between every given point and the center must be less than or equal to R
, and there must not exist such a disk with a smaller R
that also satisfies this condition.
It is possible that there will be multiple possible solutions for a given input, your code must output at least one of them in this case.
You can use any kinds of geometry builtins your language supports if there are any, and input/output may be through built-in point/disk objects instead of just numbers.
Test Cases
Input (Possible) Output(s)
(x,y) (X,Y,R)
-------------------------
(0,0) (0,0,0)
-------------------------
(0,1) (0,0,1)
(1,0) (1,1,1)
-------------------------
(1,4) (4,4,3)
(3,2)
(4,1)
(4,5)
(5,2)
(7,4)
-------------------------
(-1,0) (0,0,2)
(2,0) (1,0,2)
-------------------------
(-1,0) (1,0,2)
(2,1) (0,1,2)
Fewest bytes wins.
code-golf geometry
This challenge is about finding the smallest disk that contains some given points. This is made somewhat trickier, however, by the fact that in this challenge, the disk's coordinates and radius must both be integers.
Your input will be a list of points with integer coordinates x
and y
. You can take this as a list of tuples, a list of lists, or any other way to represent a collection of pairs. x
and y
will both be (possibly negative) integers. Every point is guaranteed to be unique, and there will be at least one point.
Your output will be a disk in the form of three numbers, X
, Y
, and R
. X
, Y
, and R
are all integers, X
and Y
represent the disk's center and R
represents its radius. The distance between every given point and the center must be less than or equal to R
, and there must not exist such a disk with a smaller R
that also satisfies this condition.
It is possible that there will be multiple possible solutions for a given input, your code must output at least one of them in this case.
You can use any kinds of geometry builtins your language supports if there are any, and input/output may be through built-in point/disk objects instead of just numbers.
Test Cases
Input (Possible) Output(s)
(x,y) (X,Y,R)
-------------------------
(0,0) (0,0,0)
-------------------------
(0,1) (0,0,1)
(1,0) (1,1,1)
-------------------------
(1,4) (4,4,3)
(3,2)
(4,1)
(4,5)
(5,2)
(7,4)
-------------------------
(-1,0) (0,0,2)
(2,0) (1,0,2)
-------------------------
(-1,0) (1,0,2)
(2,1) (0,1,2)
Fewest bytes wins.
code-golf geometry
code-golf geometry
edited 2 hours ago
asked 2 hours ago
Pavel
4,59613185
4,59613185
Sandbox
â Pavel
2 hours ago
Found a couple typos, if you don't mind me pointing them out: "This is made somewhat trickier..."; "...represents the disk's center and R represents its radius..."; "...and there must not exist such a disk..."
â J. Sallé
2 hours ago
2
Usually making things integer just make code-golf easier.
â user202729
2 hours ago
@KevinCruijssen That's by coincidence. Inputs can be in any order.
â Pavel
1 hour ago
@Pavel The input can be in any order, or we can take the input in any order? As in, the input can be in any order and we should manually sort first in our solution, or can we already take the input pre-sorted?
â Kevin Cruijssen
1 hour ago
 |Â
show 1 more comment
Sandbox
â Pavel
2 hours ago
Found a couple typos, if you don't mind me pointing them out: "This is made somewhat trickier..."; "...represents the disk's center and R represents its radius..."; "...and there must not exist such a disk..."
â J. Sallé
2 hours ago
2
Usually making things integer just make code-golf easier.
â user202729
2 hours ago
@KevinCruijssen That's by coincidence. Inputs can be in any order.
â Pavel
1 hour ago
@Pavel The input can be in any order, or we can take the input in any order? As in, the input can be in any order and we should manually sort first in our solution, or can we already take the input pre-sorted?
â Kevin Cruijssen
1 hour ago
Sandbox
â Pavel
2 hours ago
Sandbox
â Pavel
2 hours ago
Found a couple typos, if you don't mind me pointing them out: "This is made somewhat trickier..."; "...represents the disk's center and R represents its radius..."; "...and there must not exist such a disk..."
â J. Sallé
2 hours ago
Found a couple typos, if you don't mind me pointing them out: "This is made somewhat trickier..."; "...represents the disk's center and R represents its radius..."; "...and there must not exist such a disk..."
â J. Sallé
2 hours ago
2
2
Usually making things integer just make code-golf easier.
â user202729
2 hours ago
Usually making things integer just make code-golf easier.
â user202729
2 hours ago
@KevinCruijssen That's by coincidence. Inputs can be in any order.
â Pavel
1 hour ago
@KevinCruijssen That's by coincidence. Inputs can be in any order.
â Pavel
1 hour ago
@Pavel The input can be in any order, or we can take the input in any order? As in, the input can be in any order and we should manually sort first in our solution, or can we already take the input pre-sorted?
â Kevin Cruijssen
1 hour ago
@Pavel The input can be in any order, or we can take the input in any order? As in, the input can be in any order and we should manually sort first in our solution, or can we already take the input pre-sorted?
â Kevin Cruijssen
1 hour ago
 |Â
show 1 more comment
3 Answers
3
active
oldest
votes
up vote
3
down vote
Jelly, 25 24 22 21 20 18 bytes
ë/rû/Ã
Âpõó_òçýá¹ÂÃÂ,)á¹Â
Thanks to @EriktheOutgolfer for letting me know about )
, saving 1 byte.
Thanks to @Dennis for saving 2 bytes.
Try it online!
Explanation
ë/rû/Ã
Âpõó_òçýá¹ÂÃÂ,)á¹ Main link. Arg: points
e.g. [[1,4],[3,2],[3,1]]
ë/ Find minimums by coordinate
e.g. [1,1]
û/ Find maximums by coordinate
e.g. [3,4]
r Inclusive ranges by coordinate
e.g. [[1,2,3],[1,2,3,4]]
Ã
Âp Cartesian product of the x and y ranges
e.g. [[1,1],[1,2],[1,3],[1,4],...,[3,4]]
õ Chain, arg: center
e.g. [1,3]
ó Get the original points
e.g. [[1,4],[3,2],[3,1]]
_ Subtract the center from each
e.g. [[0,1],[2,-1],[2,-2]]
ò Square each number
e.g. [[0,1],[4,1],[4,4]]
ç Sum each sublist
e.g. [1,5,8]
ý Square root of each number
e.g. [1,2.24,2.83]
á¹ Find the maximum
e.g. 2.83
ÃÂ Round up
e.g. 3
, Pair with the center point
e.g. [3,[1,3]]
) Do the above for all points
e.g. [[3,[1,1]],[3,[1,2]],[3,[1,3]],...,[3,[3,4]]]
á¹ Find the lexicographically smallest pair
e.g. [3,[1,1]]
@Dennis Thanks! Since when did Jelly's vectorization repeat the shorter list, or am I misinterpreting the removal ofâ¬
?
â Pietu1998
1 hour ago
Depths are matched first. If you a pair and an array of pairs, the pair gets matched with all pairs.
â Dennisâ¦
1 hour ago
add a comment |Â
up vote
1
down vote
05AB1E, 26 bytes
øõWsàÃ
¸}`âõUIõX-nOt}àîXâÂÂ}ý
Port of @Pietu1998's Jelly answer.
Try it online or verify all test cases.
Explanation:
ø # Zip the (implicit) input, swapping the rows and column
# i.e. [[1,4],[3,2],[3,1]] â [[1,3,3],[4,2,1]]
õ # Map each to:
W # Push the smallest value (without popping the list)
# i.e. [[1,3,3],[4,2,1]] â [1,1]
s # Swap so the list is at the top of the stack again
ÃÂ # Pop the list and push the largest value
# i.e. [[1,3,3],[4,2,1]] â [3,4]
Ã
¸ # Take the inclusive range of the min and max
# i.e. [[1,2,3],[1,2,3,4]]
` # After the map, push both lists separated to the stack
â # And take the cartesian product of the two lists
# i.e. [[1,2,3],[1,2,3,4]]
# â [[1,1],[1,2],[1,3],[1,4],[2,1],[2,2],[2,3],[2,4],[3,1],[3,2],[3,3],[3,4]]
õ } # Map each pair to:
U # Pop and store the current value in variable `X`
I # Push the input
õ } # Map each pair in the input to:
X # Push variable `X`
- # Subtract it from the current pair
# i.e. [3,2] - [1,3] â [2,-1]
n # Take the square of each
# i.e. [2,-1] â [4,1]
O # Sum the lists
# i.e. [4,1] â 5
t # Take the square-root of each
# i.e. 5 â 2.23606797749979
ÃÂ # Pop the converted list, and push its largest value
# i.e. [[3.0,2.23606797749979,2.0],[2.0,2.0,2.23606797749979],...,[2.0,2.0,3.0]]
# â [3.0,2.23606797749979,...,3.0]
î # Round it up
# i.e. [3.0,2.23606797749979,...,3.0] â [3.0,3.0,3.0,4.0,4.0,3.0,3.0,4.0,4.0,3.0,3.0,3.0]
Xâ # Pair it with variable `X`
# i.e. [[3.0,[1,1]],[3.0,[1,2]],...,[3.0,[3,4]]]
Â
up vote
3
down vote
Jelly, 25 24 22 21 20 18 bytes
ë/rû/Ã
Âpõó_òçýá¹ÂÃÂ,)á¹Â
Thanks to @EriktheOutgolfer for letting me know about )
, saving 1 byte.
Thanks to @Dennis for saving 2 bytes.
Try it online!
Explanation
ë/rû/Ã
Âpõó_òçýá¹ÂÃÂ,)á¹ Main link. Arg: points
e.g. [[1,4],[3,2],[3,1]]
ë/ Find minimums by coordinate
e.g. [1,1]
û/ Find maximums by coordinate
e.g. [3,4]
r Inclusive ranges by coordinate
e.g. [[1,2,3],[1,2,3,4]]
Ã
Âp Cartesian product of the x and y ranges
e.g. [[1,1],[1,2],[1,3],[1,4],...,[3,4]]
õ Chain, arg: center
e.g. [1,3]
ó Get the original points
e.g. [[1,4],[3,2],[3,1]]
_ Subtract the center from each
e.g. [[0,1],[2,-1],[2,-2]]
ò Square each number
e.g. [[0,1],[4,1],[4,4]]
ç Sum each sublist
e.g. [1,5,8]
ý Square root of each number
e.g. [1,2.24,2.83]
á¹ Find the maximum
e.g. 2.83
ÃÂ Round up
e.g. 3
, Pair with the center point
e.g. [3,[1,3]]
) Do the above for all points
e.g. [[3,[1,1]],[3,[1,2]],[3,[1,3]],...,[3,[3,4]]]
á¹ Find the lexicographically smallest pair
e.g. [3,[1,1]]
up vote
1
down vote
05AB1E, 26 bytes
øõWsàÃ
¸`âõUIõX-nOt}àîXâÂÂ}ý
Port of @Pietu1998's Jelly answer.
Try it online or verify all test cases.
Explanation:
ø # Zip the (implicit) input, swapping the rows and column
# i.e. [[1,4],[3,2],[3,1]] â [[1,3,3],[4,2,1]]
õ # Map each to:
W # Push the smallest value (without popping the list)
# i.e. [[1,3,3],[4,2,1]] â [1,1]
s # Swap so the list is at the top of the stack again
ÃÂ # Pop the list and push the largest value
# i.e. [[1,3,3],[4,2,1]] â [3,4]
Ã
¸ # Take the inclusive range of the min and max
# i.e. [[1,2,3],[1,2,3,4]]
` # After the map, push both lists separated to the stack
â # And take the cartesian product of the two lists
# i.e. [[1,2,3],[1,2,3,4]]
# â [[1,1],[1,2],[1,3],[1,4],[2,1],[2,2],[2,3],[2,4],[3,1],[3,2],[3,3],[3,4]]
õ } # Map each pair to:
U # Pop and store the current value in variable `X`
I # Push the input
õ } # Map each pair in the input to:
X # Push variable `X`
- # Subtract it from the current pair
# i.e. [3,2] - [1,3] â [2,-1]
n # Take the square of each
# i.e. [2,-1] â [4,1]
O # Sum the lists
# i.e. [4,1] â 5
t # Take the square-root of each
# i.e. 5 â 2.23606797749979
ÃÂ # Pop the converted list, and push its largest value
# i.e. [[3.0,2.23606797749979,2.0],[2.0,2.0,2.23606797749979],...,[2.0,2.0,3.0]]
# â [3.0,2.23606797749979,...,3.0]
î # Round it up
# i.e. [3.0,2.23606797749979,...,3.0] â [3.0,3.0,3.0,4.0,4.0,3.0,3.0,4.0,4.0,3.0,3.0,3.0]
Xâ # Pair it with variable `X`
# i.e. [[3.0,[1,1]],[3.0,[1,2]],...,[3.0,[3,4]]]
# After the map, sort the list
ý # And take the first item (which is output implicitly)
# i.e. [[3.0,[1,1]],[3.0,[1,2]],...,[3.0,[3,4]]] â [3.0,[1,1]]
05AB1E, 26 bytes
øõWsàÃ
¸`âõUIõX-nOt}àîXâÂÂ}ý
Port of @Pietu1998's Jelly answer.
Try it online or verify all test cases.
Explanation:
ø # Zip the (implicit) input, swapping the rows and column
# i.e. [[1,4],[3,2],[3,1]] â [[1,3,3],[4,2,1]]
õ # Map each to:
W # Push the smallest value (without popping the list)
# i.e. [[1,3,3],[4,2,1]] â [1,1]
s # Swap so the list is at the top of the stack again
ÃÂ # Pop the list and push the largest value
# i.e. [[1,3,3],[4,2,1]] â [3,4]
Ã
¸ # Take the inclusive range of the min and max
# i.e. [[1,2,3],[1,2,3,4]]
` # After the map, push both lists separated to the stack
â # And take the cartesian product of the two lists
# i.e. [[1,2,3],[1,2,3,4]]
# â [[1,1],[1,2],[1,3],[1,4],[2,1],[2,2],[2,3],[2,4],[3,1],[3,2],[3,3],[3,4]]
õ } # Map each pair to:
U # Pop and store the current value in variable `X`
I # Push the input
õ } # Map each pair in the input to:
X # Push variable `X`
- # Subtract it from the current pair
# i.e. [3,2] - [1,3] â [2,-1]
n # Take the square of each
# i.e. [2,-1] â [4,1]
O # Sum the lists
# i.e. [4,1] â 5
t # Take the square-root of each
# i.e. 5 â 2.23606797749979
ÃÂ # Pop the converted list, and push its largest value
# i.e. [[3.0,2.23606797749979,2.0],[2.0,2.0,2.23606797749979],...,[2.0,2.0,3.0]]
# â [3.0,2.23606797749979,...,3.0]
î # Round it up
# i.e. [3.0,2.23606797749979,...,3.0] â [3.0,3.0,3.0,4.0,4.0,3.0,3.0,4.0,4.0,3.0,3.0,3.0]
Xâ # Pair it with variable `X`
# i.e. [[3.0,[1,1]],[3.0,[1,2]],...,[3.0,[3,4]]]
{ # After the map, sort the list
ý # And take the first item (which is output implicitly)
# i.e. [[3.0,[1,1]],[3.0,[1,2]],...,[3.0,[3,4]]] â [3.0,[1,1]]
answered 20 mins ago
Kevin Cruijssen
33k554176
33k554176
add a comment |Â
add a comment |Â
up vote
0
down vote
Javascript, 245 bytes
a=>[b,c,d,e]=a.reduce(([j,k,l,m],[h,i])=>[j>h?j:h,k<h?k:h,l>i?l:i,m<i?m:i],[,,,,]);for(f=c;f<b;f++)for(g=e;g<d;g++)s=a.reduce((o,[p,q])=>o>(r=(p-f)**2+(q-g)**2)?o:r);n=n?n[2]>s?[f,g,s]:n:[f,g,s]return [n[0],n[1],Math.ceil(Math.sqrt(n[2]))]
(Somewhat) more readable version:
a=>
[b,c,d,e]=a.reduce(([j,k,l,m],[h,i])=>[j>h?j:h,k<h?k:h,l>i?l:i,m<i?m:i],[,,,,]);
for(f=c;f<b;f++)
for(g=e;g<d;g++)
s=a.reduce((o,[p,q])=>o>(r=(p-f)**2+(q-g)**2)?o:r);
n=n?n[2]>s?[f,g,s]:n:[f,g,s]
return [n[0],n[1],Math.ceil(Math.sqrt(n[2]))]
Just finds the bounding box, and tests each coordinate in that box for whether it's the best.
I could save 8 bytes with an approximate answer, by replacing:
Math.ceil(Math.sqrt(n[2]))
with ~~(n[2]+1-1e-9)
add a comment |Â
up vote
0
down vote
Javascript, 245 bytes
a=>[b,c,d,e]=a.reduce(([j,k,l,m],[h,i])=>[j>h?j:h,k<h?k:h,l>i?l:i,m<i?m:i],[,,,,]);for(f=c;f<b;f++)for(g=e;g<d;g++)s=a.reduce((o,[p,q])=>o>(r=(p-f)**2+(q-g)**2)?o:r);n=n?n[2]>s?[f,g,s]:n:[f,g,s]return [n[0],n[1],Math.ceil(Math.sqrt(n[2]))]
(Somewhat) more readable version:
a=>
[b,c,d,e]=a.reduce(([j,k,l,m],[h,i])=>[j>h?j:h,k<h?k:h,l>i?l:i,m<i?m:i],[,,,,]);
for(f=c;f<b;f++)
for(g=e;g<d;g++)
s=a.reduce((o,[p,q])=>o>(r=(p-f)**2+(q-g)**2)?o:r);
n=n?n[2]>s?[f,g,s]:n:[f,g,s]
return [n[0],n[1],Math.ceil(Math.sqrt(n[2]))]
Just finds the bounding box, and tests each coordinate in that box for whether it's the best.
I could save 8 bytes with an approximate answer, by replacing:
Math.ceil(Math.sqrt(n[2]))
with ~~(n[2]+1-1e-9)
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Javascript, 245 bytes
a=>[b,c,d,e]=a.reduce(([j,k,l,m],[h,i])=>[j>h?j:h,k<h?k:h,l>i?l:i,m<i?m:i],[,,,,]);for(f=c;f<b;f++)for(g=e;g<d;g++)s=a.reduce((o,[p,q])=>o>(r=(p-f)**2+(q-g)**2)?o:r);n=n?n[2]>s?[f,g,s]:n:[f,g,s]return [n[0],n[1],Math.ceil(Math.sqrt(n[2]))]
(Somewhat) more readable version:
a=>
[b,c,d,e]=a.reduce(([j,k,l,m],[h,i])=>[j>h?j:h,k<h?k:h,l>i?l:i,m<i?m:i],[,,,,]);
for(f=c;f<b;f++)
for(g=e;g<d;g++)
s=a.reduce((o,[p,q])=>o>(r=(p-f)**2+(q-g)**2)?o:r);
n=n?n[2]>s?[f,g,s]:n:[f,g,s]
return [n[0],n[1],Math.ceil(Math.sqrt(n[2]))]
Just finds the bounding box, and tests each coordinate in that box for whether it's the best.
I could save 8 bytes with an approximate answer, by replacing:
Math.ceil(Math.sqrt(n[2]))
with ~~(n[2]+1-1e-9)
Javascript, 245 bytes
a=>[b,c,d,e]=a.reduce(([j,k,l,m],[h,i])=>[j>h?j:h,k<h?k:h,l>i?l:i,m<i?m:i],[,,,,]);for(f=c;f<b;f++)for(g=e;g<d;g++)s=a.reduce((o,[p,q])=>o>(r=(p-f)**2+(q-g)**2)?o:r);n=n?n[2]>s?[f,g,s]:n:[f,g,s]return [n[0],n[1],Math.ceil(Math.sqrt(n[2]))]
(Somewhat) more readable version:
a=>
[b,c,d,e]=a.reduce(([j,k,l,m],[h,i])=>[j>h?j:h,k<h?k:h,l>i?l:i,m<i?m:i],[,,,,]);
for(f=c;f<b;f++)
for(g=e;g<d;g++)
s=a.reduce((o,[p,q])=>o>(r=(p-f)**2+(q-g)**2)?o:r);
n=n?n[2]>s?[f,g,s]:n:[f,g,s]
return [n[0],n[1],Math.ceil(Math.sqrt(n[2]))]
Just finds the bounding box, and tests each coordinate in that box for whether it's the best.
I could save 8 bytes with an approximate answer, by replacing:
Math.ceil(Math.sqrt(n[2]))
with ~~(n[2]+1-1e-9)
answered 12 mins ago
Spitemaster
1814
1814
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f175405%2fsmallest-integer-disk%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sandbox
â Pavel
2 hours ago
Found a couple typos, if you don't mind me pointing them out: "This is made somewhat trickier..."; "...represents the disk's center and R represents its radius..."; "...and there must not exist such a disk..."
â J. Sallé
2 hours ago
2
Usually making things integer just make code-golf easier.
â user202729
2 hours ago
@KevinCruijssen That's by coincidence. Inputs can be in any order.
â Pavel
1 hour ago
@Pavel The input can be in any order, or we can take the input in any order? As in, the input can be in any order and we should manually sort first in our solution, or can we already take the input pre-sorted?
â Kevin Cruijssen
1 hour ago