Detalii evaluare #54568900

Rezumat problemă

#4357 Oxford

Premierul Marii Britanii, Rishi Sunak, a decis să reorganizeze structura administrativă a comitatului Oxfordshire. În Oxfordshire sunt prezente N orașe numerotate de la 1 la N, conectate prin M autostrăzi (drumuri unidirecționale ce conectează două orașe). Rishi a hotărât ca toate orașele cu proprietatea că cetățenii tuturor celorlalte orașe pot ajunge în ele prin intermediul autostrăzilor să devină reședințe. Deoarece numărul de orașe și autostrăzi din Oxfordshire este foarte mare, Rishi vă cere ajutorul în rezolvarea a două probleme cheie.
1. Care sunt indicii orașelor reședință din Oxfordshire.
2. Care este distanța minimă de la fiecare oraș până la cea mai apropiată reședință de acel oraș.

Detalii

Problema Oxford Operații I/O tastatură/ecran
Limita timp 0.5 secunde Limita memorie Total: 128 MB / Stivă 64 MB
Id soluție #54568900 Utilizator Kristensen Chelcea Nicolae Teodor (kristensen_nicolae)
Fișier oxford.cpp Dimensiune 3.42 KB
Data încărcării 02 Decembrie 2024, 18:38 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

oxford.cpp: In function 'void findResidences(int, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&, std::vector<int>&)':
oxford.cpp:37:23: error: no match for 'operator<=' (operand types are 'int' and 'std::vector<bool>')
     for (int i = 1; i <= visited)

                       ^
oxford.cpp:37:23: note: candidates are:
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 oxford.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:239:5: note: template<class _T1, class _T2> constexpr bool std::operator<=(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
     operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
     ^
/usr/include/c++/4.8/bits/stl_pair.h:239:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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 oxford.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:315:5: note: template<class _Iterator> bool std::operator<=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator<=(const reverse_iterator<_Iterator>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:315:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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 oxford.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:365:5: note: template<class _IteratorL, class _IteratorR> bool std::operator<=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator<=(const reverse_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:365:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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 oxford.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:1067:5: note: template<class _IteratorL, class _IteratorR> bool std::operator<=(const std::move_iterator<_Iterator>&, const std::move_iterator<_IteratorR>&)
     operator<=(const move_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:1067:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::move_iterator<_Iterator>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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 oxford.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:1073:5: note: template<class _Iterator> bool std::operator<=(const std::move_iterator<_Iterator>&, const std::move_iterator<_Iterator>&)
     operator<=(const move_iterator<_Iterator>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:1073:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::move_iterator<_Iterator>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 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 oxford.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2643:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2643:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::basic_string<_CharT, _Traits, _Alloc>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 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 oxford.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2655:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2655:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::basic_string<_CharT, _Traits, _Alloc>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 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 oxford.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2667:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator<=(const _CharT* __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2667:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const _CharT*' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/vector:64:0,
                 from oxford.cpp:2:
/usr/include/c++/4.8/bits/stl_vector.h:1440:5: note: template<class _Tp, class _Alloc> bool std::operator<=(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)
     operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
     ^
/usr/include/c++/4.8/bits/stl_vector.h:1440:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/deque:64:0,
                 from /usr/include/c++/4.8/queue:60,
                 from oxford.cpp:3:
/usr/include/c++/4.8/bits/stl_deque.h:301:5: note: template<class _Tp, class _Ref, class _Ptr> bool std::operator<=(const std::_Deque_iterator<_Tp, _Ref, _Ptr>&, const std::_Deque_iterator<_Tp, _Ref, _Ptr>&)
     operator<=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
     ^
/usr/include/c++/4.8/bits/stl_deque.h:301:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::_Deque_iterator<_Tp, _Ref, _Ptr>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/deque:64:0,
                 from /usr/include/c++/4.8/queue:60,
                 from oxford.cpp:3:
/usr/include/c++/4.8/bits/stl_deque.h:308:5: note: template<class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR> bool std::operator<=(const std::_Deque_iterator<_Tp, _Ref, _Ptr>&, const std::_Deque_iterator<_Tp, _RefR, _PtrR>&)
     operator<=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
     ^
/usr/include/c++/4.8/bits/stl_deque.h:308:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::_Deque_iterator<_Tp, _Ref, _Ptr>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/deque:64:0,
                 from /usr/include/c++/4.8/queue:60,
                 from oxford.cpp:3:
/usr/include/c++/4.8/bits/stl_deque.h:1997:5: note: template<class _Tp, class _Alloc> bool std::operator<=(const std::deque<_Tp, _Alloc>&, const std::deque<_Tp, _Alloc>&)
     operator<=(const deque<_Tp, _Alloc>& __x,
     ^
/usr/include/c++/4.8/bits/stl_deque.h:1997:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::deque<_Tp, _Alloc>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/queue:64:0,
                 from oxford.cpp:3:
/usr/include/c++/4.8/bits/stl_queue.h:304:5: note: template<class _Tp, class _Seq> bool std::operator<=(const std::queue<_Tp, _Seq>&, const std::queue<_Tp, _Seq>&)
     operator<=(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
     ^
/usr/include/c++/4.8/bits/stl_queue.h:304:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::queue<_Tp, _Seq>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/tuple:39:0,
                 from /usr/include/c++/4.8/functional:55,
                 from /usr/include/c++/4.8/bits/stl_algo.h:66,
                 from /usr/include/c++/4.8/algorithm:62,
                 from oxford.cpp:4:
/usr/include/c++/4.8/array:251:5: note: template<class _Tp, unsigned int _Nm> bool std::operator<=(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&)
     operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
     ^
/usr/include/c++/4.8/array:251:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::array<_Tp, _Nm>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/functional:55:0,
                 from /usr/include/c++/4.8/bits/stl_algo.h:66,
                 from /usr/include/c++/4.8/algorithm:62,
                 from oxford.cpp:4:
/usr/include/c++/4.8/tuple:847:5: note: template<class ... _TElements, class ... _UElements> constexpr bool std::operator<=(const std::tuple<_Elements ...>&, const std::tuple<_Elements ...>&)
     operator<=(const tuple<_TElements...>& __t,
     ^
/usr/include/c++/4.8/tuple:847:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const std::tuple<_Elements ...>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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 oxford.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:860:5: note: template<class _Iterator, class _Container> bool __gnu_cxx::operator<=(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)
     operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:860:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' and 'int'
     for (int i = 1; i <= visited)

                          ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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 oxford.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:854:5: note: template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<=(const __gnu_cxx::__normal_iterator<_IteratorL, _Container>&, const __gnu_cxx::__normal_iterator<_IteratorR, _Container>&)
     operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:854:5: note:   template argument deduction/substitution failed:
oxford.cpp:37:26: note:   mismatched types 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' and 'int'
     for (int i = 1; i <= visited)

                          ^
oxford.cpp:37:33: error: expected ';' before ')' token
     for (int i = 1; i <= visited)

                                 ^

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 Oxford 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ă.