#4638
Se dă un graf neorientat cu n vârfuri, m muchii și un vârf k. Să se determine vârfurile cele mai îndepărtate de vârful k.
| Problema | Dmaxk | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64845634 | Utilizator | |
| Fișier | dmaxk.cpp | Dimensiune | 1021 B |
| Data încărcării | 06 Iunie 2026, 13:21 | Scor/rezultat | Eroare de compilare |
dmaxk.cpp: In function ‘void bfs(int)’: dmaxk.cpp:14:5: error: reference to ‘rank’ is ambiguous 14 | rank[start] = 0; | ^~~~ In file included from /usr/include/c++/13/bits/move.h:37, from /usr/include/c++/13/bits/exception_ptr.h:41, from /usr/include/c++/13/exception:164, from /usr/include/c++/13/ios:41, from /usr/include/c++/13/ostream:40, from /usr/include/c++/13/iostream:41, from dmaxk.cpp:1: /usr/include/c++/13/type_traits:1356:12: note: candidates are: ‘template<class> struct std::rank’ 1356 | struct rank | ^~~~ dmaxk.cpp:9:5: note: ‘int rank [100005]’ 9 | int rank[NMAX]; | ^~~~ dmaxk.cpp:23:17: error: reference to ‘rank’ is ambiguous 23 | if (rank[y] == -1) | ^~~~ /usr/include/c++/13/type_traits:1356:12: note: candidates are: ‘template<class> struct std::rank’ 1356 | struct rank | ^~~~ dmaxk.cpp:9:5: note: ‘int rank [100005]’ 9 | int rank[NMAX]; | ^~~~ dmaxk.cpp:25:17: error: reference to ‘rank’ is ambiguous 25 | rank[y] = rank[x] + 1; | ^~~~ /usr/include/c++/13/type_traits:1356:12: note: candidates are: ‘template<class> struct std::rank’ 1356 | struct rank | ^~~~ dmaxk.cpp:9:5: note: ‘int rank [100005]’ 9 | int rank[NMAX]; | ^~~~ dmaxk.cpp:25:27: error: reference to ‘rank’ is ambiguous 25 | rank[y] = rank[x] + 1; | ^~~~ /usr/include/c++/13/type_traits:1356:12: note: candidates are: ‘template<class> struct std::rank’ 1356 | struct rank | ^~~~ dmaxk.cpp:9:5: note: ‘int rank [100005]’ 9 | int rank[NMAX]; | ^~~~ dmaxk.cpp: In function ‘int main()’: dmaxk.cpp:41:9: error: ‘g’ was not declared in this scope 41 | g[x].push_back(y); | ^ dmaxk.cpp:49:13: error: reference to ‘rank’ is ambiguous 49 | if (rank[i] > mx) | ^~~~ /usr/include/c++/13/type_traits:1356:12: note: candidates are: ‘template<class> struct std::rank’ 1356 | struct rank | ^~~~ dmaxk.cpp:9:5: note: ‘int rank [100005]’ 9 | int rank[NMAX]; | ^~~~ dmaxk.cpp:51:18: error: reference to ‘rank’ is ambiguous 51 | mx = rank[i]; | ^~~~ /usr/include/c++/13/type_traits:1356:12: note: candidates are: ‘template<class> struct std::rank’ 1356 | struct rank | ^~~~ dmaxk.cpp:9:5: note: ‘int rank [100005]’ 9 | int rank[NMAX]; | ^~~~ dmaxk.cpp:57:13: error: reference to ‘rank’ is ambiguous 57 | if (rank[i] == mx) | ^~~~ /usr/include/c++/13/type_traits:1356:12: note: candidates are: ‘template<class> struct std::rank’ 1356 | struct rank | ^~~~ dmaxk.cpp:9:5: note: ‘int rank [100005]’ 9 | int rank[NMAX]; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Dmaxk 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ă.