QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#805238#9869. Horizon Scanningdashenaaa#WA 0ms4280kbC++20907b2024-12-08 14:50:592024-12-08 14:51:00

Judging History

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

  • [2024-12-08 14:51:00]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4280kb
  • [2024-12-08 14:50:59]
  • 提交

answer

#include<bits/stdc++.h>
#define pi pair<int,int>
#define pb push_back
#define vec vector<int>
using namespace std;
#define int long long
#define M 998244353
#define eps 1e-9
void in(int &x){
    int f=1;x=0;
    char c=getchar();
    while(!isdigit(c)&&c!='-')c=getchar();
    if(c=='-')f=-1,c=getchar();
    while(isdigit(c))x=x*10+c-'0',c=getchar();
    x*=f;
}
int t,n,m,k,x,y;
double a[2000005];
void solve(){
    in(n);in(m);
    for(int i=1;i<=n;i++){
        in(x);in(y);
        a[i]=atan2(y,x);
    }
    sort(a+1,a+1+n);for(int i=1;i<=n;i++)a[i+n]=a[i];
    double ans=0,p=2*acos(-1.0);
    if(m==n){
        printf("%.9lf\n",p);
        return;
    }
    for(int i=1;i<=n;i++){
        if(a[i+m]>a[i]+eps)ans=max(ans,a[i+m]-a[i]);
        else ans=max(ans,a[i+m]-a[i]+p);
    }
    printf("%.9lf\n",ans);
}
signed main(){
    in(t);
    while(t--)solve();
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 4280kb

input:

5
1 1
0 1
8 2
1 0
1 1
0 1
-1 1
-1 0
-1 -1
0 -1
1 -1
4 2
-1 1
0 1
0 2
1 1
4 2
-1000000000 0
-998244353 1
998244353 1
1000000000 0
3 1
0 1
0 2
0 -1

output:

6.283185307
1.570796327
5.497787144
3.141592655
6.283185307

result:

wrong answer 5th numbers differ - expected: '3.1415927', found: '6.2831853', error = '1.0000000'