#413
Adiacenta1
Se dă lista muchiilor unui graf neorientat. Să se afișeze matricea de adiacență a grafului.
Problema | Adiacenta1 | Operații I/O |
adiacenta1.in /adiacenta1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50044352 | Utilizator | |
Fișier | adiacenta1.cpp | Dimensiune | 562 B |
Data încărcării | 25 Martie 2024, 12:05 | Scor / rezultat | Eroare de compilare |
adiacenta1.cpp:4:28: error: expected ')' before ';' token ofstream g("adiacenta1.out"; ^ adiacenta1.cpp: In function 'int main()': adiacenta1.cpp:8:22: error: expected '(' before 'not' token while not(eof(f)) ^ adiacenta1.cpp:8:31: error: 'eof' was not declared in this scope while not(eof(f)) ^ adiacenta1.cpp:9:19: error: expected ')' before '{' token { f>>x>>y; a[x][y]=1; a[y][x]=1; ^ adiacenta1.cpp:10:30: error: reference to 'max' is ambiguous if (x>=max) max=x; ^ adiacenta1.cpp:5:33: note: candidates are: int max int a[101][101]={0}, max=0; ^ 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 adiacenta1.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) ^ adiacenta1.cpp:10:35: error: reference to 'max' is ambiguous if (x>=max) max=x; ^ adiacenta1.cpp:5:33: note: candidates are: int max int a[101][101]={0}, max=0; ^ 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 adiacenta1.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) ^ adiacenta1.cpp:11:27: error: reference to 'max' is ambiguous if (y>=max) max=y;} ^ adiacenta1.cpp:5:33: note: candidates are: int max int a[101][101]={0}, max=0; ^ 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 adiacenta1.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) ^ adiacenta1.cpp:11:32: error: reference to 'max' is ambiguous if (y>=max) max=y;} ^ adiacenta1.cpp:5:33: note: candidates are: int max int a[101][101]={0}, max=0; ^ 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 adiacenta1.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) ^ adiacenta1.cpp:13:29: error: reference to 'max' is ambiguous for(int i=1; i<=max;i++} ^ adiacenta1.cpp:5:33: note: candidates are: int max int a[101][101]={0}, max=0; ^ 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 adiacenta1.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) ^ adiacenta1.cpp:13:36: error: expected ')' before '}' token for(int i=1; i<=max;i++} ^ adiacenta1.cpp:13:36: error: expected primary-expression before '}' token adiacenta1.cpp:13:36: error: expected ';' before '}' token adiacenta1.cpp: At global scope: adiacenta1.cpp:14:17: error: expected unqualified-id before '{' token {for(int j=1; j<=max;j++) ^ adiacenta1.cpp:18:17: error: expected unqualified-id before 'return' return 0;} ^ adiacenta1.cpp:18:26: error: expected declaration before '}' token return 0;} ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Adiacenta1 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ă.