Borderou de evaluare (job #3171716)
Utilizator | Data | 19 noiembrie 2023 14:39:40 | |
---|---|---|---|
Problema | Cablaj | Status | done |
Runda | Arhiva de probleme | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:269:45: error: 'function' in namespace 'std' does not name a template type
269 | Graph getMinimumSpanningTree(const std::function<double(const U&)> getWeigth) const {
| ^~~~~~~~
main.cpp:7:1: note: 'std::function' is defined in header '<functional>'; did you forget to '#include <functional>'?
6 | #include <queue>
+++ |+#include <functional>
7 |
main.cpp:269:53: error: expected ',' or '...' before '<' token
269 | Graph getMinimumSpanningTree(const std::function<double(const U&)> getWeigth) const {
| ^
main.cpp: In member function 'Graph<T, U, directed> Graph<T, U, directed>::getMinimumSpanningTree(int) const':
main.cpp:275:26: error: 'getWeigth' was not declared in this scope
275 | auto compare = [&getWeigth](const EdgePair& a, const EdgePair& b) {
| ^~~~~~~~~
main.cpp: In lambda function:
main.cpp:276:20: error: 'getWeigth' is not captured
276 | return getWeigth(a.data) > getWeigth(b.data);
| ^~~~~~~~~
main.cpp:275:35: note: the lambda has no capture-default
275 | auto compare = [&getWeigth](const EdgePair& a, const EdgePair& b) {
| ^
main.cpp:275:26: note: '<typeprefixerror>getWeigth' declared here
275 | auto compare = [&getWeigth](const EdgePair& a, const EdgePair& b) {
| ^~~~~~~~~
main.cpp:276:40: error: 'getWeigth' is not captured
276 | return getWeigth(a.data) > getWeigth(b.data);
| ^~~~~~~~~
main.cpp:275:35: note: the lambda has no capture-default
275 | auto compare = [&getWeigth](const EdgePair& a, const EdgePair& b) {
| ^
main.cpp:275:26: note: '<typeprefixerror>getWeigth' declared here
275 | auto compare = [&getWeigth](const EdgePair& a, const EdgePair& b) {
| ^~~~~~~~~
main.cpp: In function 'Graph<NodeData, EdgeData> buildGraphFromPoints(const std::vector<std::pair<double, double> >&)':
main.cpp:334:34: error: 'sqrt' is not a member of 'std'
334 | double length = std::sqrt(std::pow(points[i].first - points[j].first, 2) + std::pow(points[i].second - points[j].second, 2));
| ^~~~
main.cpp:334:44: error: 'pow' is not a member of 'std'
334 | double length = std::sqrt(std::pow(points[i].first - points[j].first, 2) + std::pow(points[i].second - points[j].second, 2));
| ^~~
main.cpp:334:93: error: 'pow' is not a member of 'std'
334 | double length = std::sqrt(std::pow(points[i].first - points[j].first, 2) + std::pow(points[i].second - points[j].second, 2));
| ^~~
main.cpp: In function 'int main_cablaj()':
main.cpp:348:22: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
348 | for(int i = 0; i < n; i++){
| ~~^~~
main.cpp:354:45: error: invalid user-defined conversion from 'main_cablaj()::<lambda(const EdgeData&)>' to 'int' [-fpermissive]
354 | auto mst = graph.getMinimumSpanningTree([](const EdgeData& edge) -> double{
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !