QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#812511#9869. Horizon Scanning_clintWA 1ms4192kbC++17767b2024-12-13 16:22:032024-12-13 16:22:14

Judging History

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

  • [2024-12-13 16:22:14]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4192kb
  • [2024-12-13 16:22:03]
  • 提交

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(15) << ans << '\n'; 
    }
    return 0;
}

詳細信息

Test #1:

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

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.283185307179586
3.141592653589793
5.497787143782138
3.141592654591552
3.141592653589793

result:

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