Borderou de evaluare (job #1692891)

Utilizator y0rgEmacu Geo y0rg Data 21 aprilie 2016 21:51:48
Problema Arbore partial de cost minim Status done
Runda Arhiva educationala Compilator cpp | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: user.cpp:64:24: error: template argument 1 is invalid typedef pair<tuple, int> triple; ^ user.cpp:64:32: error: invalid type in declaration before ‘;’ token typedef pair<tuple, int> triple; ^ user.cpp: In member function ‘bool comparator::operator()(triple, triple)’: user.cpp:70:14: error: request for member ‘second’ in ‘x’, which is of non-class type ‘triple {aka int}’ return x.second > y.second; ^ user.cpp:70:25: error: request for member ‘second’ in ‘y’, which is of non-class type ‘triple {aka int}’ return x.second > y.second; ^ user.cpp: In function ‘void print_triple(std::ostream&, triple)’: user.cpp:76:14: error: request for member ‘first’ in ‘x’, which is of non-class type ‘triple {aka int}’ out << x.first.first << ", " << x.first.second << " ->" << x.second << endl; ^ user.cpp:76:39: error: request for member ‘first’ in ‘x’, which is of non-class type ‘triple {aka int}’ out << x.first.first << ", " << x.first.second << " ->" << x.second << endl; ^ user.cpp:76:66: error: request for member ‘second’ in ‘x’, which is of non-class type ‘triple {aka int}’ out << x.first.first << ", " << x.first.second << " ->" << x.second << endl; ^ user.cpp: In function ‘void print_edge(std::ostream&, triple)’: user.cpp:81:14: error: request for member ‘first’ in ‘x’, which is of non-class type ‘triple {aka int}’ out << x.first.first << " " << x.first.second << endl; ^ user.cpp:81:38: error: request for member ‘first’ in ‘x’, which is of non-class type ‘triple {aka int}’ out << x.first.first << " " << x.first.second << endl; ^ user.cpp: In function ‘int main()’: user.cpp:100:40: error: expression list treated as compound expression in functional cast [-fpermissive] heap.push(triple(tuple(x, y), c)); ^ user.cpp:100:25: error: expected primary-expression before ‘(’ token heap.push(triple(tuple(x, y), c)); ^ user.cpp:100:26: error: reference to ‘tuple’ is ambiguous heap.push(triple(tuple(x, y), c)); ^ user.cpp:63:24: note: candidates are: typedef struct std::pair<int, int> tuple typedef pair<int, int> tuple; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, 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_pair.h:83:11: note: template<class ...> class std::tuple

Ceva nu functioneaza?