Submission #429704

#TimeUsernameProblemLanguageResultExecution timeMemory
429704Mounir이상적인 도시 (IOI12_city)C++14
0 / 100
5 ms716 KiB
#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]; long long inv(long long a, long long b){ return 1<a ? b - inv(b%a,a)*b/a : 1; } int DistanceSum(int nVilles, int *X, int *Y) { vector<int> 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...