#545
Euler
Se dă un graf neorientat cu n
vârfuri care este conex și are gradele tuturor vârfurilor pare. Determinați un ciclu eulerian.
Problema | Euler | Operații I/O |
euler.in /euler.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #29980803 | Utilizator | |
Fișier | euler.cpp | Dimensiune | 1.57 KB |
Data încărcării | 04 Iunie 2021, 10:40 | Scor / rezultat | Eroare de compilare |
euler.cpp:51:13: error: redefinition of 'std::ifstream in' ifstream in ("dmax.in"); ^ euler.cpp:7:10: error: 'std::ifstream in' previously declared here ifstream in("euler.in"); ^ euler.cpp:52:14: error: redefinition of 'std::ofstream out' ofstream out ("dmax.out"); ^ euler.cpp:8:10: error: 'std::ofstream out' previously declared here ofstream out("euler.out"); ^ euler.cpp:54:19: error: conflicting declaration 'std::vector<int> v [101]' vector <int> v[101]; ^ euler.cpp:12:13: error: 'v' has a previous declaration as 'std::vector<int> v' vector<int> v; ^ euler.cpp:56:12: error: conflicting declaration 'bool ok [101]' bool ok[101]; ^ euler.cpp:10:6: error: 'ok' has a previous declaration as 'bool ok [201][201]' bool ok[201][201]; ^ euler.cpp: In function 'void bfs(int)': euler.cpp:62:10: error: incompatible types in assignment of 'int' to 'bool [201]' ok[x]=1; ^ euler.cpp:67:31: error: request for member 'size' in 'v.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)nod))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' for (int i=0;i<v[nod].size();i++) ^ euler.cpp:68:28: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}[int]' for array subscript if (ok[v[nod][i]]==0) ^ euler.cpp:69:28: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}[int]' for array subscript ok[v[nod][i]]=1,q.push(v[nod][i]),cnt[v[nod][i]]=cnt[nod]+1,maxx=max(maxx,cnt[v[nod][i]]); ^ euler.cpp:69:48: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}[int]' for array subscript ok[v[nod][i]]=1,q.push(v[nod][i]),cnt[v[nod][i]]=cnt[nod]+1,maxx=max(maxx,cnt[v[nod][i]]); ^ euler.cpp:69:63: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}[int]' for array subscript ok[v[nod][i]]=1,q.push(v[nod][i]),cnt[v[nod][i]]=cnt[nod]+1,maxx=max(maxx,cnt[v[nod][i]]); ^ euler.cpp:69:103: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}[int]' for array subscript ok[v[nod][i]]=1,q.push(v[nod][i]),cnt[v[nod][i]]=cnt[nod]+1,maxx=max(maxx,cnt[v[nod][i]]); ^ euler.cpp: In function 'int main()': euler.cpp:73:5: error: redefinition of 'int main()' int main() ^ euler.cpp:33:5: error: 'int main()' previously defined here int main() ^ euler.cpp:78:14: error: request for member 'push_back' in 'v.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)a))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' v[a].push_back(b),v[b].push_back(a); ^ euler.cpp:78:32: error: request for member 'push_back' in 'v.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)b))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' v[a].push_back(b),v[b].push_back(a); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Euler 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ă.