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 <cstdio>
int main () {
int N;
int L[111111];
int P[111111];
scanf("%d", &N);
for (int i=0; i<N; i++) {
scanf("%d %d", &L[i], &P[i]);
}
int sum=0;
int c1,c2,c;
for (int i=0; i<N-1; i++) {
for (int j=i+1; j<N; j++) {
if (L[i]>=L[j]) c1=L[i]-L[j];
else c1=(L[i]-L[j])*-1;
if (P[i]>=P[j]) c2=P[i]-P[j];
else c2=(P[i]-P[j])*-1;
c=c1*c2;
sum+=c;
}
}
printf("%d", sum);
return 0;
}
# | 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... |