【CodeForces】[667]Pouring Rain

这里写图片描述

上个月参加的一场CF
当时忘了写博客了

就是有一杯水
一边喝一边添
问能否喝完
并问如果能那么需要多少秒

#include<stdio.h>
#include<math.h>
#define PI acos(-1.0)
int main() {
    int d,h,v,e;
    while(scanf("%d %d %d %d",&d,&h,&v,&e)!=EOF) {
        double S=PI*((d/2.0)*(d/2.0));
        double gv=S*e;
        if(gv>v) {
            printf("NO
");
            continue;
        } else {
            printf("YES
");
            printf("%lf
",h*S/(v-gv));
        }
    }
    return 0;
}

题目地址:【CodeForces】[667]Pouring Rain

原文地址:https://www.cnblogs.com/BoilTask/p/12569550.html