#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 | #63194446 | Utilizator | |
| Fișier | ccmax.cpp | Dimensiune | 936 B |
| Data încărcării | 20 Februarie 2026, 08:27 | Scor/rezultat | Eroare de compilare |
ccmax.cpp: In function 'int main()': ccmax.cpp:32:29: error: 'i' was not declared in this scope for(int k = 1; k <= ct; i++){ ^ ccmax.cpp:39:19: error: reference to 'max' is ambiguous if(ctnd > max){ ^ ccmax.cpp:6:39: note: candidates are: int max int a[101][101], v[101], n, ct, ctnd, max, ctcx; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from ccmax.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ ccmax.cpp:40:11: error: reference to 'max' is ambiguous max = ctnd; ^ ccmax.cpp:6:39: note: candidates are: int max int a[101][101], v[101], n, ct, ctnd, max, ctcx; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from ccmax.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ ccmax.cpp:45:20: error: reference to 'max' is ambiguous if(v[i] == max){ ^ ccmax.cpp:6:39: note: candidates are: int max int a[101][101], v[101], n, ct, ctnd, max, ctcx; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from ccmax.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^
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ă.