QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#753393#9576. Ordainer of Inexorable Judgmentforget-star#WA 0ms3996kbC++17873b2024-11-16 12:42:412024-11-16 12:42:43

Judging History

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

  • [2024-12-23 14:23:26]
  • hack成功,自动添加数据
  • (/hack/1303)
  • [2024-12-06 11:32:56]
  • hack成功,自动添加数据
  • (/hack/1271)
  • [2024-11-16 12:42:43]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3996kb
  • [2024-11-16 12:42:41]
  • 提交

answer

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<cmath>
using namespace std;
typedef long double ld;
const int N=110;
const ld pai=acos(-1.0);
struct node
{
	ld x,y;
}p0,p[N];
int n,d,T;
ld s[N<<1],s0;
int main()
{
	scanf("%d%Lf%Lf%d%d",&n,&p0.x,&p0.y,&d,&T);s0=atan2(p0.y,p0.x);
	for(int i=1;i<=n;i++)
	{
		scanf("%Lf%Lf",&p[i].x,&p[i].y);
		ld t=atan2(p[i].y,p[i].x),dt=atan2(d,sqrt(p[i].x*p[i].x+p[i].y*p[i].y-d*d));
		s[2*i-1]=t-dt,s[2*i]=t+dt;
	}
	ld L=pai*3.0,R=-pai*3.0;
	for(int i=1;i<=2*n;i++)
	{
		ld t=s[i];
		while(t<s0) t+=pai*2.0;
		L=min(L,t-s0),R=max(R,t-s0);
	}
//	printf("L=%.7Lf R=%.7Lf\n",L,R);
	ld t1=floor(T/(pai*2.0)),t2=T-pai*2.0*t1;
	ld ans=t1*(R-L)+max((ld)0.0,min(t2,R)-L);
	printf("%.12Lf\n",ans);
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3968kb

input:

3 1 0 1 1
1 2
2 1
2 2

output:

1.000000000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3896kb

input:

3 1 0 1 2
1 2
2 1
2 2

output:

1.570796326795

result:

ok found '1.5707963', expected '1.5707963', error '0.0000000'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3984kb

input:

3 1 0 1 10000
1 2
2 1
2 2

output:

2500.707752257475

result:

ok found '2500.7077523', expected '2500.7077523', error '0.0000000'

Test #4:

score: -100
Wrong Answer
time: 0ms
memory: 3996kb

input:

3 10000 10000 1 10000
10000 9999
10000 10000
9999 10000

output:

9999.934074615240

result:

wrong answer 1st numbers differ - expected: '0.3842413', found: '9999.9340746', error = '9999.5498333'