Detalii evaluare #64330464

Rezumat problemă

Dijkstra are nevoie de ajutorul vostru pentru a-și duce la bun sfârșit datoria. Acesta vrea să afle drumurile de lungime minimă de la casa prietenului său Vlad la celelalte case ale vecinilor. Nu are foarte mult timp la dispoziție așa ca trebuie să vă mișcați repede. Îl veți ajuta?

Detalii

Problema Dijkstra2 Operații I/O dijkstra2.in/dijkstra2.out
Limita timp 0.2 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #64330464 Utilizator Achim Victor (ACVictor)
Fișier dijkstra2.cpp Dimensiune 1.53 KB
Data încărcării 30 Aprilie 2026, 08:36 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

dijkstra2.cpp:23:1: error: ‘vector’ does not name a type
   23 | vector<Muchie> leg[MAX];
      | ^~~~~~
dijkstra2.cpp: In function ‘void citire()’:
dijkstra2.cpp:34:9: error: ‘leg’ was not declared in this scope
   34 |         leg[a].push_back(Muchie(b, c));
      |         ^~~
dijkstra2.cpp: In function ‘void ext_per(int)’:
dijkstra2.cpp:40:20: error: ‘leg’ was not declared in this scope
   40 |     for(Muchie m : leg[p]) {
      |                    ^~~
dijkstra2.cpp: In function ‘int main()’:
dijkstra2.cpp:64:26: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::list<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   64 |         for(int i = 0; i < per.size(); ++i) {
      |                        ~~^~~~~~~~~~~~
dijkstra2.cpp:65:27: error: no match for ‘operator[]’ (operand types are ‘std::__cxx11::list<int>’ and ‘int’)
   65 |             if(costuri[per[i]] < minimum) {
      |                           ^
dijkstra2.cpp:66:38: error: no match for ‘operator[]’ (operand types are ‘std::__cxx11::list<int>’ and ‘int’)
   66 |                 minimum = costuri[per[i]];
      |                                      ^
dijkstra2.cpp:71:20: error: no match for ‘operator[]’ (operand types are ‘std::__cxx11::list<int>’ and ‘int’)
   71 |         ext_per(per[min_index]);
      |                    ^
dijkstra2.cpp:72:31: error: no match for ‘operator+’ (operand types are ‘std::__cxx11::list<int>::iterator’ and ‘int’)
   72 |         per.erase(per.begin() + min_index);
      |                   ~~~~~~~~~~~ ^ ~~~~~~~~~
      |                            |    |
      |                            |    int
      |                            std::__cxx11::list<int>::iterator
In file included from /usr/include/c++/13/string:48,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/bits/ios_base.h:41,
                 from /usr/include/c++/13/ios:44,
                 from /usr/include/c++/13/istream:40,
                 from /usr/include/c++/13/fstream:40,
                 from dijkstra2.cpp:1:
/usr/include/c++/13/bits/stl_iterator.h:634:5: note: candidate: ‘template<class _Iterator> std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)’
  634 |     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:634:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   mismatched types ‘const std::reverse_iterator<_Iterator>’ and ‘int’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1808:5: note: candidate: ‘template<class _Iterator> std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)’
 1808 |     operator+(typename move_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1808:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   mismatched types ‘const std::move_iterator<_IteratorL>’ and ‘int’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
In file included from /usr/include/c++/13/string:54:
/usr/include/c++/13/bits/basic_string.h:3553:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’
 3553 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3553:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   ‘std::__cxx11::list<int>::iterator’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3571:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’
 3571 |     operator+(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3571:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   mismatched types ‘const _CharT*’ and ‘std::_List_iterator<int>’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3590:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’
 3590 |     operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3590:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   mismatched types ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘int’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3607:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)’
 3607 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3607:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   ‘std::__cxx11::list<int>::iterator’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3625:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)’
 3625 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3625:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   ‘std::__cxx11::list<int>::iterator’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3637:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’
 3637 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3637:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   ‘std::__cxx11::list<int>::iterator’ is not derived from ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3644:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, __cxx11::basic_string<_CharT, _Traits, _Alloc>&&)’
 3644 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3644:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   ‘std::__cxx11::list<int>::iterator’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3651:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, __cxx11::basic_string<_CharT, _Traits, _Alloc>&&)’
 3651 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3651:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   ‘std::__cxx11::list<int>::iterator’ is not derived from ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3674:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Alloc>&&)’
 3674 |     operator+(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3674:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   mismatched types ‘const _CharT*’ and ‘std::_List_iterator<int>’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3681:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Alloc>&&)’
 3681 |     operator+(_CharT __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3681:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   mismatched types ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘int’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3688:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _CharT*)’
 3688 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3688:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   ‘std::__cxx11::list<int>::iterator’ is not derived from ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3695:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, _CharT)’
 3695 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3695:5: note:   template argument deduction/substitution failed:
dijkstra2.cpp:72:33: note:   ‘std::__cxx11::list<int>::iterator’ is not derived from ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
   72 |         per.erase(per.begin() + min_index);
      |                                 ^~~~~~~~~

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema Dijkstra2 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.

Du-te sus!