Borderou de evaluare (job #1471546)

Utilizator SilviuIIon Silviu SilviuI Data 14 august 2015 12:36:31
Problema Cele mai apropiate puncte din plan Status done
Runda Arhiva educationala Compilator cpp | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: user.cpp: In function ‘ll ok(date, date)’: user.cpp:40:45: error: call of overloaded ‘abs(double)’ is ambiguous if (x.x==y.x) return abs(double(y.y-x.y)); else ^ user.cpp:40:45: note: candidates are: In file included from /usr/include/c++/4.8/cstdlib:72:0, from /usr/include/c++/4.8/bits/stl_algo.h:59, from /usr/include/c++/4.8/algorithm:62, from user.cpp:4: /usr/include/stdlib.h:771:12: note: int abs(int) extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; ^ user.cpp:26:15: note: double abs(double) inline double abs(double x) { if (x<0) return (-x); else return x; } ^ In file included from /usr/include/c++/4.8/random:38:0, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from user.cpp:4: /usr/include/c++/4.8/cmath:91:3: note: constexpr long double std::abs(long double) abs(long double __x) ^ /usr/include/c++/4.8/cmath:87:3: note: constexpr float std::abs(float) abs(float __x) ^ /usr/include/c++/4.8/cmath:81:3: note: constexpr double std::abs(double) abs(double __x) ^ In file included from /usr/include/c++/4.8/bits/stl_algo.h:59:0, from /usr/include/c++/4.8/algorithm:62, from user.cpp:4: /usr/include/c++/4.8/cstdlib:174:3: note: long long int std::abs(long long int) abs(long long __x) { return __builtin_llabs (__x); } ^ /usr/include/c++/4.8/cstdlib:166:3: note: long int std::abs(long int) abs(long __i) { return __builtin_labs(__i); } ^ user.cpp: In function ‘int main()’: user.cpp:47:49: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘ll* {aka long long int*}’ [-Wformat=] for (i=1;i<=n;i++) scanf("%d %d",&t[i].x,&t[i].y); ^ user.cpp:47:49: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘ll* {aka long long int*}’ [-Wformat=] user.cpp:51:38: error: call of overloaded ‘abs(double)’ is ambiguous if (abs(double(t[j].y-t[i].y))<sol) sol=min(sol,distan(t[j],t[i])); ^ user.cpp:51:38: note: candidates are: In file included from /usr/include/c++/4.8/cstdlib:72:0, from /usr/include/c++/4.8/bits/stl_algo.h:59, from /usr/include/c++/4.8/algorithm:62, from user.cpp:4:

Ceva nu functioneaza?