QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#479783#784. 旋转卡壳NOI_AK_ME#0 1ms5852kbC++231008b2024-07-15 20:51:572024-07-15 20:51:57

Judging History

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

  • [2024-10-16 12:18:36]
  • hack成功,自动添加数据
  • (/hack/1005)
  • [2024-09-24 16:55:39]
  • hack成功,自动添加数据
  • (/hack/888)
  • [2024-07-31 21:52:32]
  • hack成功,自动添加数据
  • (/hack/764)
  • [2024-07-31 21:47:53]
  • hack成功,自动添加数据
  • (/hack/763)
  • [2024-07-15 20:51:57]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:5852kb
  • [2024-07-15 20:51:57]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<ctime>
using namespace std;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+(ch&15);ch=getchar();}
	return x*f;
}
const int N=5e5+10;
int n,w,x[N],y[N];
long long ans;
inline long long dis(int a,int b){
	return 1ll*(x[a]-x[b])*(x[a]-x[b])+1ll*(y[a]-y[b])*(y[a]-y[b]);
}
signed main()
{
    //srand(time(0)+114514);
    n=read();
    for(register int i=1;i<=n;i++)
		x[i]=read(),y[i]=read();
    int i=3;
    for(register int t=1;t<=3;t++){
        long long maxn=0;
		int p=0;
        for(register int j=1;j<=n;j++){
            w=dis(i,j);
			if(w>maxn){
				maxn=w;
				p=j;
			}
        }
        ans=max(ans,maxn);
		i=p;
    }
    printf("%.15Lf",sqrt(ans));
    return 0;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 5852kb

input:

1000
0 0
-997615 -8573
-1988394 -28911
-2726572 -44296
-3491635 -60392
-4419752 -82814
-5298550 -105946
-5723430 -118453
-6608257 -147267
-7034966 -161982
-7563964 -181682
-8507871 -222865
-9499799 -271846
-10090186 -303547
-10400262 -322989
-10614073 -339725
-11081438 -378596
-11791568 -439127
-127...

output:

-nan

result:

wrong output format Expected double, but "-nan" found

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #1:

0%