# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1039814 |
2024-07-31T09:40:30 Z |
onbert |
Ideal city (IOI12_city) |
C++17 |
|
19 ms |
2140 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int M = 1e9;
int32_t DistanceSum(int32_t n, int32_t X[], int32_t Y[]) {
int ans = 0, sum = 0;
sort(X, X+n);
for (int i=0;i<n;i++) ans += i * X[i] - sum, ans %= M, sum += X[i];
sum = 0;
sort(Y, Y+n);
for (int i=0;i<n;i++) ans += i * Y[i] - sum, ans %= M, sum += Y[i];
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
604 KB |
Output is correct |
2 |
Correct |
4 ms |
564 KB |
Output is correct |
3 |
Correct |
9 ms |
1116 KB |
Output is correct |
4 |
Correct |
9 ms |
1136 KB |
Output is correct |
5 |
Correct |
19 ms |
1880 KB |
Output is correct |
6 |
Correct |
18 ms |
1884 KB |
Output is correct |
7 |
Correct |
19 ms |
2140 KB |
Output is correct |
8 |
Correct |
18 ms |
1884 KB |
Output is correct |
9 |
Correct |
18 ms |
1884 KB |
Output is correct |
10 |
Correct |
17 ms |
1880 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |