QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#753866#9576. Ordainer of Inexorable Judgmentforget-star#WA 0ms3964kbC++171.2kb2024-11-16 13:46:022024-11-16 13:46:02

Judging History

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

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

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);s0+=pai*2.0;
	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++)
	{
		while(s[i]<0) s[i]+=pai*2.0;
		L=min(L,s[i]),R=max(R,s[i]);
	}
//	printf("L=%.7Lf R=%.7Lf\n",L,R);
	ld ans=0;
	if(s0<L)
	{
		ld t1=floor(T/(pai*2.0)),t2=T-pai*2.0*t1;
		ans=t1*(R-L)+max((ld)0,min(s0+t2,R)-L);
	}
	else if(s0>R)
	{
		ld t1=floor(T/(pai*2.0)),t2=T-pai*2.0*t1;
		L+=pai*2.0,R+=pai*2.0;
		ans=t1*(R-L)+max((ld)0,min(s0+t2,R)-L);
	}
	else
	{
		ld t1=floor(T/(pai*2.0)),t2=T-pai*2.0*t1;
		ans=t1*(R-L)+max((ld)0,min(s0+t2,R)-s0);
		L+=pai*2.0,R+=pai*2.0;
		ans+=max((ld)0,min(s0+t2,R)-L);
	}
	printf("%.12Lf\n",ans);
	return 0;
}

詳細信息

Test #1:

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

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: 3932kb

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: 3848kb

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: 3964kb

input:

3 10000 10000 1 10000
10000 9999
10000 10000
9999 10000

output:

0.384362017004

result:

wrong answer 1st numbers differ - expected: '0.3842413', found: '0.3843620', error = '0.0001207'