#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 | #53841643 | Utilizator | |
Fișier | conexidad.cpp | Dimensiune | 2.81 KB |
Data încărcării | 12 Noiembrie 2024, 22:49 | Scor / rezultat | Eroare de compilare |
conexidad.cpp:85:13: error: redefinition of 'std::ifstream fin' ifstream fin("conexidad.in"); ^ conexidad.cpp:6:10: error: 'std::ifstream fin' previously declared here ifstream fin("conexidad.in"); ^ conexidad.cpp:86:14: error: redefinition of 'std::ofstream fout' ofstream fout("conexidad.out"); ^ conexidad.cpp:7:10: error: 'std::ofstream fout' previously declared here ofstream fout("conexidad.out"); ^ conexidad.cpp:88:11: error: redefinition of 'const int nmax' const int nmax=101; ^ conexidad.cpp:9:11: error: 'const int nmax' previously defined here const int nmax=101; ^ conexidad.cpp:89:5: error: redefinition of 'int n' int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:10:5: error: 'int n' previously declared here int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:89:7: error: redefinition of 'int m' int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:10:7: error: 'int m' previously declared here int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:89:9: error: redefinition of 'int x' int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:10:9: error: 'int x' previously declared here int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:89:11: error: redefinition of 'int y' int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:10:11: error: 'int y' previously declared here int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:89:13: error: redefinition of 'int l' int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:10:13: error: 'int l' previously declared here int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:89:15: error: redefinition of 'int k' int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:10:15: error: 'int k' previously declared here int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:89:17: error: redefinition of 'int np' int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:10:17: error: 'int np' previously declared here int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:89:20: error: redefinition of 'int nr' int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:10:20: error: 'int nr' previously declared here int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:89:23: error: redefinition of 'int lmax' int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:10:23: error: 'int lmax' previously declared here int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:89:28: error: redefinition of 'int j' int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:10:28: error: 'int j' previously declared here int n,m,x,y,l,k,np,nr,lmax,j; ^ conexidad.cpp:91:19: error: redefinition of 'std::vector<int> gr [101]' vector<int>gr[nmax],cn[nmax],sol; ^ conexidad.cpp:12:12: error: 'std::vector<int> gr [101]' previously declared here vector<int>gr[nmax],cn[nmax],sol; ^ conexidad.cpp:91:28: error: redefinition of 'std::vector<int> cn [101]' vector<int>gr[nmax],cn[nmax],sol; ^ conexidad.cpp:12:21: error: 'std::vector<int> cn [101]' previously declared here vector<int>gr[nmax],cn[nmax],sol; ^ conexidad.cpp:91:30: error: redefinition of 'std::vector<int> sol' vector<int>gr[nmax],cn[nmax],sol; ^ conexidad.cpp:12:30: error: 'std::vector<int> sol' previously declared here vector<int>gr[nmax],cn[nmax],sol; ^ conexidad.cpp:92:22: error: redefinition of 'std::vector<std::pair<int, int> > lu' vector<pair<int,int>>lu; ^ conexidad.cpp:13:22: error: 'std::vector<std::pair<int, int> > lu' previously declared here vector<pair<int,int>>lu; ^ conexidad.cpp:93:12: error: redefinition of 'std::vector<int> vas' vector<int>vas; ^ conexidad.cpp:14:12: error: 'std::vector<int> vas' previously declared here vector<int>vas; ^ conexidad.cpp: In function 'void dfs(int)': conexidad.cpp:95:6: error: redefinition of 'void dfs(int)' void dfs(int nod){ ^ conexidad.cpp:16:6: error: 'void dfs(int)' previously defined here void dfs(int nod){ ^ conexidad.cpp: In function 'bool adv(std::pair<int, int>, std::pair<int, int>)': conexidad.cpp:107:6: error: redefinition of 'bool adv(std::pair<int, int>, std::pair<int, int>)' bool adv(pair<int,int>x,pair<int,int>y){ ^ conexidad.cpp:28:6: error: 'bool adv(std::pair<int, int>, std::pair<int, int>)' previously defined here bool adv(pair<int,int>x,pair<int,int>y){ ^ conexidad.cpp: In function 'int main()': conexidad.cpp:113:5: error: redefinition of 'int main()' int main() ^ conexidad.cpp:34:5: error: 'int main()' previously defined here int main() ^
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ă.