Submission #24776

#TimeUsernameProblemLanguageResultExecution timeMemory
24776taehoon1018사회적 불평등 (TOKI14_social)C11
29 / 100
300 ms1780 KiB
#include<stdio.h> int abs(int x){ if(x<0) return -x; else return x; } int main(){ int N,L[100000],I[100000]; int i,j,temp; long sum=0; scanf("%d",&N); for(i=0;i<N;i++) scanf("%d %d",&L[i],&I[i]); for(i=0;i<N;i++){ for(j=i+1;j<N;j++){ temp=(L[i]-L[j])*(I[i]-I[j]); sum+=abs(temp); } } printf("%ld",sum); }

Compilation message (stderr)

social.c: In function 'main':
social.c:11:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&N);
  ^
social.c:13:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d",&L[i],&I[i]);
   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...