QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#572962 | #55. 欧几里得距离之和 | sleepy_shadow | 0 | 43ms | 4292kb | C++14 | 653b | 2024-09-18 16:56:27 | 2024-09-18 16:56:27 |
Judging History
answer
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 5e5 + 5;
const long double pi = acos((long double) -1);
ll n, x[N], y[N];
long double ans;
int main() {
scanf ("%lld", &n);
vector<pair<int, int> >a(n);
for (auto &[x, y] : a) scanf ("%d%d", &x, &y);
for (int i = 0; i < 180; ++i) {
long double t = pi / 180 * i, c = cos(t), s = sin(t);
vector<long double> p;
for (auto[x, y] : a) p.emplace_back(x * c - y * s);
sort(begin(p), end(p));
for (auto j : p) ans += j * (i * 2 - n + 1);
}
printf ("%.20Lf\n", ans * pi / 200);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 43ms
memory: 4292kb
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:
-20745459255.60486713238060474396
result:
wrong answer 1st numbers differ - expected: '4693148621177.00000', found: '-20745459255.60487', error = '1.00442'
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%