Outside Problem - Ball Bearings

Post here if you don't find any other place for your post. But please, stay on-topic: algorithms, programming or something related to this web site and its services.

Moderator: Board moderators

Post Reply
New poster
Posts: 23
Joined: Mon Oct 16, 2006 2:18 am

Outside Problem - Ball Bearings

Post by slxst »

I was looking to Ball Bearings (http://acm.pku.edu.cn/JudgeOnline/problem?id=2959)

I tried the obvious: calculate the inner circumference and divide by the number of balls plus the space required:

int howMany(double D, double d, double s)
return (jnt)( ( 3.141592653589793*(D-d) )/(d+s) );

Which seems to be OK but I got WA. I'm sure there is a nasty simple case that brings the whole thing down but I can't find it!

Can anyone help me a bit.

Post Reply

Return to “Other words”