#126
DMax
Să se determine maximul distanţelor minime între nodul 1
şi celelalte noduri, într-un graf neorientat.
Problema | DMax | Operații I/O |
dmax.in /dmax.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53847465 | Utilizator | |
Fișier | dmax.cpp | Dimensiune | 710 B |
Data încărcării | 13 Noiembrie 2024, 09:20 | Scor / rezultat | Eroare de compilare |
dmax.cpp: In function 'int main()': dmax.cpp:25:9: error: expected unqualified-id before '[' token auto[nod,dis]=q.front(); ^ dmax.cpp:28:22: error: 'nod' was not declared in this scope for(auto x:graph[nod]) ^ dmax.cpp:31:21: error: 'dis' was not declared in this scope dist[x]=dis+1; ^ dmax.cpp:32:31: error: no matching function for call to 'std::queue<std::pair<int, int> >::push(<brace-enclosed initializer list>)' q.push({x,dist[x]}); ^ dmax.cpp:32:31: note: candidates are: In file included from /usr/include/c++/4.8/queue:64:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:85, from dmax.cpp:2: /usr/include/c++/4.8/bits/stl_queue.h:212:7: note: void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, int>] push(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_queue.h:212:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<int, int>&}' /usr/include/c++/4.8/bits/stl_queue.h:217:7: note: void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, int>] push(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_queue.h:217:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<int, int> >::value_type&& {aka std::pair<int, int>&&}'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DMax face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
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ă.