QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#753391#9576. Ordainer of Inexorable Judgmentforget-star#Compile Error//C++17856b2024-11-16 12:42:112024-11-16 12:42:11

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:11]
  • 评测
  • [2024-11-16 12:42:11]
  • 提交

answer

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<map>
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;
}

详细

answer.code:12:14: error: ‘acos’ was not declared in this scope
   12 | const ld pai=acos(-1.0);
      |              ^~~~
answer.code: In function ‘int main()’:
answer.code:21:55: error: ‘atan2’ was not declared in this scope
   21 |         scanf("%d%Lf%Lf%d%d",&n,&p0.x,&p0.y,&d,&T);s0=atan2(p0.y,p0.x);
      |                                                       ^~~~~
answer.code:26:28: error: ‘dt’ was not declared in this scope; did you mean ‘t’?
   26 |                 s[2*i-1]=t-dt,s[2*i]=t+dt;
      |                            ^~
      |                            t
answer.code:36:15: error: ‘floor’ was not declared in this scope
   36 |         ld t1=floor(T/(pai*2.0)),t2=T-pai*2.0*t1;
      |               ^~~~~
answer.code:37:41: error: ‘t2’ was not declared in this scope; did you mean ‘t1’?
   37 |         ld ans=t1*(R-L)+max((ld)0.0,min(t2,R)-L);
      |                                         ^~
      |                                         t1
answer.code:21:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   21 |         scanf("%d%Lf%Lf%d%d",&n,&p0.x,&p0.y,&d,&T);s0=atan2(p0.y,p0.x);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:24:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   24 |                 scanf("%Lf%Lf",&p[i].x,&p[i].y);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~