This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define pii pair<int, int>
#define x first
#define y second
#define pb push_back
#define all(x) x.begin(), x.end()
#define chmin(x, v) x = min(x, v)
#define chmax(x, v) x = max(x, v)
using namespace std;
const int MOD = 1000000000, N = 3000;
int delta[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
bool estVille[N][N], vue[N][N];
int dist[N][N];
int DistanceSum(int nVilles, int *X, int *Y) {
vector<long long> x, y;
for (int iVille = 0; iVille < nVilles; ++iVille){
x.pb(X[iVille]);
y.pb(Y[iVille]);
}
long long SUM = 0;
for (int i = 0; i < nVilles; ++i){
SUM = (SUM + x[i] * (2 * i - nVilles + 1))%MOD;
SUM = (SUM + y[i] * (2 * i - nVilles + 1))%MOD;
}
return SUM%MOD;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |