QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#812511 | #9869. Horizon Scanning | _clint | WA | 1ms | 4192kb | C++17 | 767b | 2024-12-13 16:22:03 | 2024-12-13 16:22:14 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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'