Borderou de evaluare (job #3227365)
Utilizator | Data | 29 aprilie 2024 20:35:36 | |
---|---|---|---|
Problema | Arbore partial de cost minim | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'std::vector<edge> prim(std::map<int, std::vector<adj> >&, int, int)':
main.cpp:51:25: warning: comparison of integer expressions of different signedness: 'std::vector<edge>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
51 | while(result.size() != n - 1)
| ~~~~~~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/12.2.1/numeric:62,
from main.cpp:5:
/usr/include/c++/12.2.1/bits/stl_numeric.h: In instantiation of 'constexpr _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation) [with _InputIterator = __gnu_cxx::__normal_iterator<edge*, vector<edge> >; _Tp = int; _BinaryOperation = main()::<lambda(int&, edge&)>]':
main.cpp:106:23: required from here
/usr/include/c++/12.2.1/bits/stl_numeric.h:169:29: error: no match for call to '(main()::<lambda(int&, edge&)>) (std::remove_reference<int&>::type, edge&)'
169 | __init = __binary_op(_GLIBCXX_MOVE_IF_20(__init), *__first);
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12.2.1/bits/stl_numeric.h:169:29: note: candidate: 'int (*)(int&, edge&)' (conversion)
/usr/include/c++/12.2.1/bits/stl_numeric.h:169:29: note: conversion of argument 2 would be ill-formed:
/usr/include/c++/12.2.1/bits/stl_numeric.h:169:29: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'std::remove_reference<int&>::type' {aka 'int'}
main.cpp:101:21: note: candidate: 'main()::<lambda(int&, edge&)>' (near match)
101 | auto add_edge = [](int& acc, edge& e)
| ^
main.cpp:101:21: note: conversion of argument 1 would be ill-formed:
/usr/include/c++/12.2.1/bits/stl_numeric.h:169:29: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'std::remove_reference<int&>::type' {aka 'int'}
169 | __init = __binary_op(_GLIBCXX_MOVE_IF_20(__init), *__first);
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !