#417
Se dă lista muchiilor unui graf neorientat. Să se afișeze vârfurile de grad maxim.
| Problema | GradMax | Operații I/O |
gradmax.in/gradmax.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64558828 | Utilizator | |
| Fișier | gradmax.cpp | Dimensiune | 543 B |
| Data încărcării | 14 Mai 2026, 11:27 | Scor/rezultat | Eroare de compilare |
gradmax.cpp: In function ‘int main()’: gradmax.cpp:17:26: error: invalid types ‘int[int]’ for array subscript 17 | for(i=1; i<=n; i++) d[i]=grad(i); | ^ gradmax.cpp:19:11: error: invalid types ‘int[int]’ for array subscript 19 | if(d[i]>max) | ^ gradmax.cpp:19:15: error: reference to ‘max’ is ambiguous 19 | if(d[i]>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/istream:40, from /usr/include/c++/13/fstream:40, from gradmax.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) | ^~~ gradmax.cpp:5:28: note: ‘int max’ 5 | int n,a[101][101],i,j,d,nr,max; | ^~~ gradmax.cpp:21:7: error: reference to ‘max’ is ambiguous 21 | max=d[i]; | ^~~ /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) | ^~~ gradmax.cpp:5:28: note: ‘int max’ 5 | int n,a[101][101],i,j,d,nr,max; | ^~~ gradmax.cpp:21:12: error: invalid types ‘int[int]’ for array subscript 21 | max=d[i]; | ^ gradmax.cpp:24:14: error: invalid types ‘int[int]’ for array subscript 24 | else if(d[i]==max) nr++; | ^ gradmax.cpp:24:19: error: reference to ‘max’ is ambiguous 24 | else if(d[i]==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) | ^~~ gradmax.cpp:5:28: note: ‘int max’ 5 | int n,a[101][101],i,j,d,nr,max; | ^~~ gradmax.cpp:27:13: error: invalid types ‘int[int]’ for array subscript 27 | if(d[i]==max) g<<i<<" "; | ^ gradmax.cpp:27:18: error: reference to ‘max’ is ambiguous 27 | if(d[i]==max) g<<i<<" "; | ^~~ /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) | ^~~ gradmax.cpp:5:28: note: ‘int max’ 5 | int n,a[101][101],i,j,d,nr,max; | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GradMax 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ă.