Submission #1021763

# Submission time Handle Problem Language Result Execution time Memory
1021763 2024-07-13T04:58:49 Z vjudge1 Ideal city (IOI12_city) C++17
23 / 100
24 ms 2140 KB
#include<bits/stdc++.h>
using namespace std;
int mod=1e9;
int DistanceSum(int N, int *X, int *Y) {
    sort(X,X+N);
    sort(Y,Y+N);
    long long ans=0;
    for(long long i=0;i<N;i++){
        ans+=i*X[i] - (N-i-1) *X[i];
        ans%=mod;
    }
    for(long long i=0;i<N;i++){
        ans+=i*Y[i] - (N-i-1) *Y[i];
        ans%=mod;
    }
    return (ans+mod)%mod;
}
# 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 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 600 KB Output is correct
2 Correct 4 ms 604 KB Output is correct
3 Correct 9 ms 1112 KB Output is correct
4 Correct 9 ms 1116 KB Output is correct
5 Correct 18 ms 1884 KB Output is correct
6 Correct 18 ms 1884 KB Output is correct
7 Correct 20 ms 2140 KB Output is correct
8 Correct 24 ms 1840 KB Output is correct
9 Correct 18 ms 1884 KB Output is correct
10 Correct 18 ms 2052 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 -