Borderou de evaluare (job #2040504)

Utilizator Johnny07Savu Ioan-Daniel Johnny07 Data 15 octombrie 2017 21:41:05
Problema Project management Status done
Runda Arhiva de probleme Compilator cpp | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: user.cpp:14:23: error: ‘int time [102]’ redeclared as different kind of symbol int cost[102],time[102]; ^ In file included from /usr/include/pthread.h:26:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/gthr-default.h:35, from /usr/include/i386-linux-gnu/c++/4.8/bits/gthr.h:148, from /usr/include/c++/4.8/ext/atomicity.h:33, from /usr/include/c++/4.8/bits/ios_base.h:39, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from user.cpp:1: /usr/include/time.h:186:15: error: previous declaration of ‘time_t time(time_t*)’ extern time_t time (time_t *__timer) __THROW; ^ user.cpp: In function ‘int main()’: user.cpp:37:49: warning: pointer to a function used in arithmetic [-Wpointer-arith] if (nodb[i].size()==0) {q.push(i);time[i]=cost[i];} ^ user.cpp:37:50: error: assignment of read-only location ‘*(time + ((sizetype)i))’ if (nodb[i].size()==0) {q.push(i);time[i]=cost[i];} ^ user.cpp:37:50: error: cannot convert ‘int’ to ‘time_t(time_t*)throw () {aka long int(long int*)throw ()}’ in assignment user.cpp:47:26: warning: pointer to a function used in arithmetic [-Wpointer-arith] time[nodf[nod][i]]=max(time[nodf[nod][i]], time[nod]+cost[nodf[nod][i]]); ^ user.cpp:47:49: warning: pointer to a function used in arithmetic [-Wpointer-arith] time[nodf[nod][i]]=max(time[nodf[nod][i]], time[nod]+cost[nodf[nod][i]]); ^ user.cpp:47:60: warning: pointer to a function used in arithmetic [-Wpointer-arith] time[nodf[nod][i]]=max(time[nodf[nod][i]], time[nod]+cost[nodf[nod][i]]); ^ user.cpp:47:79: warning: pointer to a function used in arithmetic [-Wpointer-arith] time[nodf[nod][i]]=max(time[nodf[nod][i]], time[nod]+cost[nodf[nod][i]]); ^ user.cpp:47:80: error: no matching function for call to ‘max(time_t (&)(time_t*)throw (), time_t (*)(time_t*)throw ())’ time[nodf[nod][i]]=max(time[nodf[nod][i]], time[nod]+cost[nodf[nod][i]]); ^ user.cpp:47:80: note: candidates are: In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from user.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template argument deduction/substitution failed: user.cpp:47:80: note: deduced conflicting types for parameter ‘const _Tp’ (‘long int(long int*)throw ()’ and ‘time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}’) time[nodf[nod][i]]=max(time[nodf[nod][i]], time[nod]+cost[nodf[nod][i]]);

Ceva nu functioneaza?