版本比较
P3218 [HNOI]赛车游戏题解
正文
增加 5 行删除 5 行
29 行未改动30313233343435363738383940414243444546474848495051524 行未改动575859606161626364655 行未改动7172737475757677787911 行未改动29 行未改动#define LL long long#define MAXN 1000005using namespace std;const double eps=1e-15;
int T,R;double A,B,vmax,F;double X[10002],Y[10002],k[10002],len[10002];
bool check(double mid) { double lf=0; for(int i=1; i<=R; ++i) { lf+=max(0.0,mid*A+B*k[i])*len[i]; if(lf-F>eps)return 0; } if(lf-F<=eps)return 1; return 0;}
double cal(double x) { double lf=0; if(x<=eps)return 0; for(int i=1; i<=R; ++i) {4 行未改动 }else lf+=len[i]/x; } return lf;}
void work() { double l=0,r=vmax; int TYP=0; while(TYP<=100) {5 行未改动 double ans=cal(l); if(ans<=eps)printf("IMPOSSIBLE\n"); else printf("%.5lf\n",ans);}
int main() { scanf("%d",&T); while(T--) { scanf("%lf%lf%lf%lf%d",&A,&B,&vmax,&F,&R);11 行未改动