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 <stdio.h>
int Abs(int x)
{
if (x < 0)
x = -x;
return x;
}
int main(void)
{
int N;
int L[100000] = { 0 };
int P[100000] = { 0 };
long long sum = 0;
scanf("%d", &N);
for (int i = 0; i < N; i++)
scanf("%d%d", &L[i], &P[i]);
for (int i = 0; i < N - 1; i++)
for (int j = i + 1; j < N; j++)
sum += Abs(L[i] - L[j]) * Abs(P[i] - P[j]);
printf("%lld", sum);
}
# | 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... |