Post Reply 
HHC 2017 RPL Programming contest information and results thread
09-18-2017, 09:34 PM
Post: #27
RE: HHC 2017 RPL Programming contest information and results thread
(09-18-2017 08:51 PM)Claudio L. Wrote:  The idea is to choose a pair of A and B that minimizes A+B.

A=CEIL(1/x) is the smallest number for A.
B=CEIL(1/x') is the largest possible B.

So the algorithm loops from A to (A+B)/2, computing a B' for each A', and chooses the A that minimizes A+B. Doesn't choose B, as that's for the next iteration.

Of course, for large numbers this became ridiculously slow, so I decided to skip values, so it doesn't find the best A and B combination, just something better.

Nice! That's a really clever idea. I'll have to play around with that myself too.

Paul
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2017 RPL Programming contest information and results thread - pdo - 09-18-2017 09:34 PM



User(s) browsing this thread: 2 Guest(s)