QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#812508#9869. Horizon Scanning_clintWA 0ms4216kbC++20767b2024-12-13 16:21:062024-12-13 16:21:06

Judging History

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

  • [2024-12-13 16:21:06]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4216kb
  • [2024-12-13 16:21:06]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
using namespace std;
const double PI = acos(-1);

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int tt; cin >> tt;
    while(tt--){
        int n, k;
        cin >> n >> k;
        vector<double> a;
        for (int i = 0; i < n; i++) {
            double x, y;
            cin >> x >> y;
            a.push_back(atan2(y, x));
        }
        sort(a.begin(), a.end());
        for (auto d : a) {
            a.push_back(d + 2 * PI);
        }
        double ans = 0;
        for (int i = 0; i < n; i++) {
            ans = max(ans, a[i + k] - a[i]);
        }
        cout << fixed << setprecision(10) << ans << '\n'; 
    }
    return 0;
}

詳細信息

Test #1:

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

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.2831853072
3.1415926536
5.4977871438
3.1415926546
3.1415926536

result:

wrong answer 2nd numbers differ - expected: '1.5707963', found: '3.1415927', error = '1.0000000'