QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#479783 | #784. 旋转卡壳 | NOI_AK_ME# | 0 | 1ms | 5852kb | C++23 | 1008b | 2024-07-15 20:51:57 | 2024-07-15 20:51:57 |
Judging History
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%