#4067
Se dă un graf neorientat cu n vârfuri. Determinați numărul maxim de vârfuri dintr-o componentă conexă și numarul de componente conexe care au acest număr maxim de vârfuri.
| Problema | ccmax | Operații I/O |
ccmax.in/ccmax.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64775471 | Utilizator | |
| Fișier | ccmax.cpp | Dimensiune | 711 B |
| Data încărcării | 29 Mai 2026, 14:30 | Scor/rezultat | Eroare de compilare |
ccmax.cpp: In function ‘int DFS(int)’: ccmax.cpp:15:1: warning: no return statement in function returning non-void [-Wreturn-type] 15 | } | ^ ccmax.cpp: In function ‘int main()’: ccmax.cpp:24:12: error: ‘v’ was not declared in this scope 24 | if(v[i] == 0){ | ^ ccmax.cpp:28:14: error: reference to ‘max’ is ambiguous 28 | if(c>max){ | ^~~ In file included from /usr/include/c++/13/string:51, 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/ostream:40, from /usr/include/c++/13/iostream:41, from ccmax.cpp:1: /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ ccmax.cpp:6:41: note: ‘int max’ 6 | int n,i,j,V[101],M[101][101],c = 0,nr=0,max=0; | ^~~ ccmax.cpp:29:13: error: reference to ‘max’ is ambiguous 29 | max = c; | ^~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ ccmax.cpp:6:41: note: ‘int max’ 6 | int n,i,j,V[101],M[101][101],c = 0,nr=0,max=0; | ^~~ ccmax.cpp:32:22: error: reference to ‘max’ is ambiguous 32 | else if(c == max){ | ^~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ ccmax.cpp:6:41: note: ‘int max’ 6 | int n,i,j,V[101],M[101][101],c = 0,nr=0,max=0; | ^~~ ccmax.cpp:36:11: error: reference to ‘max’ is ambiguous 36 | cout<<max<<" "<< nr; | ^~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ ccmax.cpp:6:41: note: ‘int max’ 6 | int n,i,j,V[101],M[101][101],c = 0,nr=0,max=0; | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ccmax 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ă.