# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
869397 | teacup | 이상적인 도시 (IOI12_city) | C++14 | 26 ms | 1524 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int DistanceSum(int N, int *X, int *Y){
int minx=(1<<32)-1, miny=(1<<32)-1;
for (int a=0; a<N; a++) {
minx = min(minx, X[a]);
miny = min(miny, Y[a]);
}
sort(X, X+N);
sort(Y, Y+N);
long long bx=0, by=0;
for (int a=0; a<N; a++) {
bx+=(X[a]-X[0]);
by+=(Y[a]-Y[0]);
}
long long ans=(bx+by)%1000000000;
for (int a=1; a<N; a++) {
bx-=(N-a)*(X[a]-X[a-1]);
by-=(N-a)*(Y[a]-Y[a-1]);
ans=(ans+bx+by)%1000000000;
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |