Submission #17087

#TimeUsernameProblemLanguageResultExecution timeMemory
17087taehoon1018사회적 불평등 (TOKI14_social)C++98
29 / 100
300 ms1744 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...