#419
Subgraf1
Se dă lista muchiilor unui graf neorientat cu n
vârfuri, etichetate de la 1
la n
. Din acest graf se elimină toate vârfurile care au gradul minim. Să se determine câte muchii va avea subgraful obținut.
Problema | Subgraf1 | Operații I/O |
subgraf1.in /subgraf1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51979813 | Utilizator | |
Fișier | subgraf1.cpp | Dimensiune | 1.17 KB |
Data încărcării | 13 Septembrie 2024, 23:22 | Scor / rezultat | Eroare de compilare |
subgraf1.cpp: In function 'int main()': subgraf1.cpp:21:49: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' if (find(adj[x].begin(), adj[x].end(), y) == adj[x].end()) { ^ subgraf1.cpp:21:49: note: candidate is: In file included from /usr/include/c++/4.8/bits/locale_facets.h:48:0, from /usr/include/c++/4.8/bits/basic_ios.h:37, from /usr/include/c++/4.8/ios:44, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from subgraf1.cpp:1: /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&) find(istreambuf_iterator<_CharT> __first, ^ /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed: subgraf1.cpp:21:49: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' if (find(adj[x].begin(), adj[x].end(), y) == adj[x].end()) { ^ subgraf1.cpp:24:49: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' if (find(adj[y].begin(), adj[y].end(), x) == adj[y].end()) { ^ subgraf1.cpp:24:49: note: candidate is: In file included from /usr/include/c++/4.8/bits/locale_facets.h:48:0, from /usr/include/c++/4.8/bits/basic_ios.h:37, from /usr/include/c++/4.8/ios:44, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from subgraf1.cpp:1: /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&) find(istreambuf_iterator<_CharT> __first, ^ /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed: subgraf1.cpp:24:49: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' if (find(adj[y].begin(), adj[y].end(), x) == adj[y].end()) { ^ subgraf1.cpp:32:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (adj[i].size() < minEdges) { ^ subgraf1.cpp:40:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (adj[i].size() == minEdges) { ^ subgraf1.cpp:48:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int j = 0; j < adj[i].size(); ++j) { ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Subgraf1 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ă.