#2968
conexidad
Fie un graf neorientat cu N
noduri și M
muchii, care NU este conex. Să i se adauge grafului un număr minim de muchii, astfel încât acesta să devină conex. Fie extra
i
numărul de muchii nou-adăugate care sunt incidente cu nodul i
, iar max_extra
cea mai mare dintre valorile extra
1
, extra
2
,… , extra
N
. Mulțimea de muchii adăugate trebuie să respecte condiția ca valoarea max_extra să fie minimă.
OJI 2019
Problema | conexidad | Operații I/O |
conexidad.in /conexidad.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 32 MB
|
Id soluție | #55113213 | Utilizator | |
Fișier | conexidad.cpp | Dimensiune | 1.88 KB |
Data încărcării | 25 Decembrie 2024, 22:09 | Scor / rezultat | Eroare de compilare |
conexidad.cpp: In function 'int32_t main()': conexidad.cpp:26:5: error: reference to 'cin' is ambiguous cin.tie(NULL); ^ conexidad.cpp:6:10: note: candidates are: std::ifstream cin ifstream cin("conexidad.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from conexidad.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ conexidad.cpp:28:5: error: reference to 'cin' is ambiguous cin>>n>>m; ^ conexidad.cpp:6:10: note: candidates are: std::ifstream cin ifstream cin("conexidad.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from conexidad.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ conexidad.cpp:32:9: error: reference to 'cin' is ambiguous cin>>a>>b; ^ conexidad.cpp:6:10: note: candidates are: std::ifstream cin ifstream cin("conexidad.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from conexidad.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ conexidad.cpp:33:9: error: 'v' was not declared in this scope v[a].push_back(b); ^ conexidad.cpp:45:34: error: template argument 1 is invalid vector<pair<int,vector<int>> v; ^ conexidad.cpp:45:34: error: template argument 2 is invalid conexidad.cpp:48:9: error: 'v' was not declared in this scope v.push_back({comp[i].size(),comp[i]}); ^ conexidad.cpp:50:10: error: 'v' was not declared in this scope sort(v.begin(),v.end()); ^ conexidad.cpp:86:5: error: reference to 'cout' is ambiguous cout<<max_extra<<endl; ^ conexidad.cpp:7:10: note: candidates are: std::ofstream cout ofstream cout("conexidad.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from conexidad.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ conexidad.cpp:87:5: error: reference to 'cout' is ambiguous cout<<ans.size()<<endl; ^ conexidad.cpp:7:10: note: candidates are: std::ofstream cout ofstream cout("conexidad.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from conexidad.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ conexidad.cpp:90:9: error: reference to 'cout' is ambiguous cout<<el.first<<" "<<el.second<<endl; ^ conexidad.cpp:7:10: note: candidates are: std::ofstream cout ofstream cout("conexidad.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from conexidad.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema conexidad 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ă.