首页 > ACM题库 > HDU-杭电 > HDU 3317-Hot girl with cool car[解题报告]HOJ

HDU 3317-Hot girl with cool car[解题报告]HOJ

Hot girl with cool car

问题描述 :

Huahua is a beautiful girl. Since she is still single, you can imagine how many boys want to dating with her on Saint Valentine’s Day! Huahua is a clever girl, she do know well how to pick a boy by the way she like.

Unlike other girls, Huahua have a special hobby, that she is a professional fan of automobile race game. Her interest ranging widely from real car racing such as Formula 1, Dakar Rally, Le Mans World Endurance Championship, even to virtual games ,for instance, Need for Speed. Just because of this, Huahua is extremely popular in boys’ eyes. It is a universally truth that hot girl with powerful cool car, everybody becomes blood surge!

Now Huahua got an idea. You know in professional racing game, choose a most suitable path when steer is very important. It can even decide the result. Driver must know very well about the road condition, control car speed at the braking point before entering curve, and turn wheel immediately at the beginning of the curve. But when is the right time to turn? Which is the best path? Huahua rise this technical problem to you.

Suppose there is a racing track shown in Graph 1, and we are facing a regular curve. Huahua will tell you the road condition: w (Unit: Meter) stands for the track wide, r (Unit: Meter) for the turning radius (inside the track), and θ ( 0°< θ <=180°) for the the angle of the curve we discussing. Since larger turning radius can provide driver better control experience and gain more time, your task is to tell Huahua the largest turning radius driver can pick. The one who first slove this problem will become the lucky dog and able to dating with Huahua on Saint Valentine’s Day!

Mine sweeping

Graph 1: Racing Track


There are multiple cases, please process to End of File.
For each case:
Three postive real number: r, w, θ, as described above.


There are multiple cases, please process to End of File.
For each case:
Three postive real number: r, w, θ, as described above.


30 70 90



using namespace std;
double pi=acos(-1);
double w,r,sita;
int main() {
        double umc=cos(sita/2.)-1.;
    return 0;

  1. int half(int *array,int len,int key)
    int l=0,r=len;
    int m=(l+r)>>1;
    if(key>array )l=m+1;
    else if(key<array )r=m;
    else return m;
    return -1;

  2. 这道题目的核心一句话是:取还是不取。

  3. 思路二可以用一个长度为k的队列来实现,入队后判断下队尾元素的next指针是否为空,若为空,则出队指针即为所求。