QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#52363 | #55. 欧几里得距离之和 | crazy_sea | 0 | 0ms | 0kb | C++ | 513b | 2022-10-04 12:02:41 | 2022-10-04 12:02:42 |
Judging History
answer
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
const int K=100000,N=5e5+10;
const long double pi=acos(-1.0);
long double x[N],y[N],z[N],ans,c,s,e,p;
int n;
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%Lf%Lf",&x[i],&y[i]);
e=pi*2/K;
for(int j=0;j<K;j++)
{
c=cos(j*pi*2/K);
s=sin(j*pi*2/K);
for(int i=1;i<=n;i++) z[i]=x[i]*c-y[i]*s;
sort(z+1,z+n+1);
for(int i=1;i<n;i++)
ans+=(z[i+1]-z[i])*i*(n-i)*e;
}
printf("%.10Lf",ans/4);
}
詳細信息
Subtask #1:
score: 0
Time Limit Exceeded
Test #1:
score: 0
Time Limit Exceeded
input:
3000 -802420 -321989 227507 956314 -460698 -819834 -479809 -341770 191520 109304 712327 -189558 -578326 -41090 282566 982266 -859119 686756 209058 -23298 -884994 -349898 -11358 182915 -507706 -81622 745434 575941 -374809 139274 810223 367608 960234 -197223 439081 573568 -275182 999306 -583036 -61808...
output:
result:
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
0%