On Sunday, March 19, 2017 at 12:50:30 AM UTC+5:30, Xiongqi ZHANG wrote:
> Please also describe how you will sort the coordinates.
> 
> 
> 在 2017年3月18日星期六 UTC-7下午12:16:07,Anurag Rai写道:
> > https://codejam.withgoogle.com/codejam/contest/8284486/dashboard#s=p2
> > 
> > 
> > What I thought : Sort the coordinates in term of x, y and z values. Loop 
> > over i from 0 to n-1, and divide stars into (0,i) and (i+1, n) and compute 
> > cube edges to cover stars (0,i) and (i+1, n). The max of these two is the 
> > edge length required to cover the two partitions of stars.
> > Answer is the minimum edge for all i's. 
> > Is there something wrong in this algorithm ? If yes, how do i begin solving 
> > it!
> > 
> > Thanks!

I tried two sorting approach:

-> one simply based on the (x, y, z) values. sort based on x values, if x is 
same, sort based on y values, if y is same, sort based on z values. 


-> sort based on (x-r, y-r, z-r), where r is the radius.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/b608d41f-eb91-468c-8bec-ce7cc69f7bae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to