QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#159506#7110. Kuririn MIRACLEucup-team206#WA 0ms3956kbC++171.2kb2023-09-02 17:59:462023-09-02 17:59:46

Judging History

你现在查看的是最新测评结果

  • [2023-09-02 17:59:46]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3956kb
  • [2023-09-02 17:59:46]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

#define double long double

const double eps=1e-7,pi=acos(-1);

int T;

double v,r,d;

double f(double x)
{
	double sx=sin(x);
	return 2*r/v/(sqrt(sx*sx+3)-sx);
}

double F(double l,double r)
{
	return (f(l)+f(r)+4*f((l+r)/2))*(r-l)/6.0;
}

double I(double l,double r)
{
	double mid=(l+r)/2;
	if(fabs(F(l,r)-F(l,mid)-F(mid,r))<eps)
		return F(l,mid)+F(mid,r);
	return I(l,mid)+I(mid,r);
}

double check(double a,double b)
{
	double t=I(0,a);
	double x=2*r+v*t-cos(a)*2*r;
	double y=sin(a)*2*r;
	double ax=x-y/tan(a);

	t=I(0,b);
	x=2*r+v*t-cos(b)*2*r;
	y=sin(b)*2*r;
	double bx=x-y/tan(b);

	if(ax>bx)
		swap(ax,bx);
	return ax<=d&&d<=bx;
}

int main()
{
	scanf("%d",&T);
	while(T--)
	{
		scanf("%Lf%Lf%Lf",&v,&r,&d);
		double tl=I(0,pi);
		if(tl>d/v)
			printf("%.10Lf\n",d/v);
		else
		{
			double L=pi/2,R=pi;
			while((R-L)/max((double)1.0,R)>eps)
			{
				double mid=(L+R)/2;
				if(check(L,mid))
					R=mid;
				else
					L=mid;
			}
			double a=(L+R)/2;
			double t=I(0,a);
			double x=2*r+v*t-cos(a)*2*r;
			double y=sin(a)*2*r;
			t+=sqrt((d-x)*(d-x)+y*y)/(v*2);
			printf("%.10Lf\n",t);
		}
	}
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3956kb

input:

1
2.00 3 30.0

output:

8.3107615194

result:

wrong answer 1st numbers differ - expected: '8.3105799', found: '8.3107615', error = '0.0000218'