Submission #8589

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