Submission #8588

#TimeUsernameProblemLanguageResultExecution timeMemory
8588yuioyuio사회적 불평등 (TOKI14_social)C++98
Compilation error
0 ms0 KiB
#include <cstdio> #include <cmath> 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 c; for (int i=0; i<N-1; i++) { for (int j=i+1; j<N; j++) { c=abs(L[i]-L[j])*abs(P[i]-P[j]); sum+=c; } } printf("%d", sum); return 0; }

Compilation message (stderr)

social.cpp: In function 'int main()':
social.cpp:18:19: error: 'abs' was not declared in this scope
social.cpp:18:19: note: suggested alternative:
/usr/include/c++/4.6/cmath:96:5: note:   'std::abs'
social.cpp:9:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
social.cpp:11:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]