Submission #1039814

#TimeUsernameProblemLanguageResultExecution timeMemory
1039814onbertIdeal city (IOI12_city)C++17
23 / 100
19 ms2140 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...