#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 |
1 |
Correct |
0 ms |
1744 KB |
Output is correct |
2 |
Correct |
0 ms |
1740 KB |
Output is correct |
3 |
Correct |
0 ms |
1740 KB |
Output is correct |
4 |
Correct |
0 ms |
1740 KB |
Output is correct |
5 |
Correct |
0 ms |
1740 KB |
Output is correct |
6 |
Correct |
0 ms |
1740 KB |
Output is correct |
7 |
Correct |
0 ms |
1740 KB |
Output is correct |
8 |
Correct |
5 ms |
1744 KB |
Output is correct |
9 |
Correct |
16 ms |
1740 KB |
Output is correct |
10 |
Correct |
39 ms |
1740 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
300 ms |
1736 KB |
Program timed out |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
300 ms |
1736 KB |
Program timed out |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
300 ms |
1740 KB |
Program timed out |
2 |
Halted |
0 ms |
0 KB |
- |