#441
ComponenteConexe1
Se dă lista muchiilor unui graf neorientat. Să se determine numărul minim de muchii care trebuie adăugate pentru ca graful să devină conex, precum și un set de asemenea muchii.
Problema | ComponenteConexe1 | Operații I/O |
componenteconexe1.in /componenteconexe1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #7465876 | Utilizator | |
Fișier | componenteconexe1.cpp | Dimensiune | 5.32 KB |
Data încărcării | 12 Decembrie 2017, 12:13 | Scor / rezultat | Eroare de compilare |
componenteconexe1.cpp:52:13: error: redefinition of 'std::ifstream fin' ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:6:10: error: 'std::ifstream fin' previously declared here ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:53:14: error: redefinition of 'std::ofstream fout' ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:7:10: error: 'std::ofstream fout' previously declared here ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:55:5: error: redefinition of 'int n' int n, tot; ^ componenteconexe1.cpp:9:5: error: 'int n' previously declared here int n, tot; ^ componenteconexe1.cpp:55:8: error: redefinition of 'int tot' int n, tot; ^ componenteconexe1.cpp:9:8: error: 'int tot' previously declared here int n, tot; ^ componenteconexe1.cpp:56:15: error: redefinition of 'int v [101][101]' int v[101][101]; ^ componenteconexe1.cpp:10:5: error: 'int v [101][101]' previously declared here int v[101][101]; ^ componenteconexe1.cpp:57:10: error: redefinition of 'int s [101]' int s[101]; ^ componenteconexe1.cpp:11:5: error: 'int s [101]' previously declared here int s[101]; ^ componenteconexe1.cpp:58:5: error: redefinition of 'int k' int k; ^ componenteconexe1.cpp:12:5: error: 'int k' previously declared here int k; ^ componenteconexe1.cpp:59:12: error: redefinition of 'int sol [101]' int sol[101]; ^ componenteconexe1.cpp:13:5: error: 'int sol [101]' previously declared here int sol[101]; ^ componenteconexe1.cpp: In function 'void citire()': componenteconexe1.cpp:61:6: error: redefinition of 'void citire()' void citire() ^ componenteconexe1.cpp:15:6: error: 'void citire()' previously defined here void citire() ^ componenteconexe1.cpp: In function 'void dfs(int)': componenteconexe1.cpp:71:6: error: redefinition of 'void dfs(int)' void dfs(int nod) ^ componenteconexe1.cpp:25:6: error: 'void dfs(int)' previously defined here void dfs(int nod) ^ componenteconexe1.cpp: In function 'int main()': componenteconexe1.cpp:79:5: error: redefinition of 'int main()' int main() ^ componenteconexe1.cpp:33:5: error: 'int main()' previously defined here int main() ^ componenteconexe1.cpp: At global scope: componenteconexe1.cpp:98:13: error: redefinition of 'std::ifstream fin' ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:6:10: error: 'std::ifstream fin' previously declared here ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:99:14: error: redefinition of 'std::ofstream fout' ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:7:10: error: 'std::ofstream fout' previously declared here ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:101:5: error: redefinition of 'int n' int n, tot; ^ componenteconexe1.cpp:9:5: error: 'int n' previously declared here int n, tot; ^ componenteconexe1.cpp:101:8: error: redefinition of 'int tot' int n, tot; ^ componenteconexe1.cpp:9:8: error: 'int tot' previously declared here int n, tot; ^ componenteconexe1.cpp:102:15: error: redefinition of 'int v [101][101]' int v[101][101]; ^ componenteconexe1.cpp:10:5: error: 'int v [101][101]' previously declared here int v[101][101]; ^ componenteconexe1.cpp:103:10: error: redefinition of 'int s [101]' int s[101]; ^ componenteconexe1.cpp:11:5: error: 'int s [101]' previously declared here int s[101]; ^ componenteconexe1.cpp:104:5: error: redefinition of 'int k' int k; ^ componenteconexe1.cpp:12:5: error: 'int k' previously declared here int k; ^ componenteconexe1.cpp:105:12: error: redefinition of 'int sol [101]' int sol[101]; ^ componenteconexe1.cpp:13:5: error: 'int sol [101]' previously declared here int sol[101]; ^ componenteconexe1.cpp: In function 'void citire()': componenteconexe1.cpp:107:6: error: redefinition of 'void citire()' void citire() ^ componenteconexe1.cpp:15:6: error: 'void citire()' previously defined here void citire() ^ componenteconexe1.cpp: In function 'void dfs(int)': componenteconexe1.cpp:117:6: error: redefinition of 'void dfs(int)' void dfs(int nod) ^ componenteconexe1.cpp:25:6: error: 'void dfs(int)' previously defined here void dfs(int nod) ^ componenteconexe1.cpp: In function 'int main()': componenteconexe1.cpp:125:5: error: redefinition of 'int main()' int main() ^ componenteconexe1.cpp:33:5: error: 'int main()' previously defined here int main() ^ componenteconexe1.cpp: At global scope: componenteconexe1.cpp:144:13: error: redefinition of 'std::ifstream fin' ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:6:10: error: 'std::ifstream fin' previously declared here ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:145:14: error: redefinition of 'std::ofstream fout' ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:7:10: error: 'std::ofstream fout' previously declared here ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:147:5: error: redefinition of 'int n' int n, tot; ^ componenteconexe1.cpp:9:5: error: 'int n' previously declared here int n, tot; ^ componenteconexe1.cpp:147:8: error: redefinition of 'int tot' int n, tot; ^ componenteconexe1.cpp:9:8: error: 'int tot' previously declared here int n, tot; ^ componenteconexe1.cpp:148:15: error: redefinition of 'int v [101][101]' int v[101][101]; ^ componenteconexe1.cpp:10:5: error: 'int v [101][101]' previously declared here int v[101][101]; ^ componenteconexe1.cpp:149:10: error: redefinition of 'int s [101]' int s[101]; ^ componenteconexe1.cpp:11:5: error: 'int s [101]' previously declared here int s[101]; ^ componenteconexe1.cpp:150:5: error: redefinition of 'int k' int k; ^ componenteconexe1.cpp:12:5: error: 'int k' previously declared here int k; ^ componenteconexe1.cpp:151:12: error: redefinition of 'int sol [101]' int sol[101]; ^ componenteconexe1.cpp:13:5: error: 'int sol [101]' previously declared here int sol[101]; ^ componenteconexe1.cpp: In function 'void citire()': componenteconexe1.cpp:153:6: error: redefinition of 'void citire()' void citire() ^ componenteconexe1.cpp:15:6: error: 'void citire()' previously defined here void citire() ^ componenteconexe1.cpp: In function 'void dfs(int)': componenteconexe1.cpp:163:6: error: redefinition of 'void dfs(int)' void dfs(int nod) ^ componenteconexe1.cpp:25:6: error: 'void dfs(int)' previously defined here void dfs(int nod) ^ componenteconexe1.cpp: In function 'int main()': componenteconexe1.cpp:171:5: error: redefinition of 'int main()' int main() ^ componenteconexe1.cpp:33:5: error: 'int main()' previously defined here int main() ^ componenteconexe1.cpp: At global scope: componenteconexe1.cpp:190:13: error: redefinition of 'std::ifstream fin' ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:6:10: error: 'std::ifstream fin' previously declared here ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:191:14: error: redefinition of 'std::ofstream fout' ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:7:10: error: 'std::ofstream fout' previously declared here ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:193:5: error: redefinition of 'int n' int n, tot; ^ componenteconexe1.cpp:9:5: error: 'int n' previously declared here int n, tot; ^ componenteconexe1.cpp:193:8: error: redefinition of 'int tot' int n, tot; ^ componenteconexe1.cpp:9:8: error: 'int tot' previously declared here int n, tot; ^ componenteconexe1.cpp:194:15: error: redefinition of 'int v [101][101]' int v[101][101]; ^ componenteconexe1.cpp:10:5: error: 'int v [101][101]' previously declared here int v[101][101]; ^ componenteconexe1.cpp:195:10: error: redefinition of 'int s [101]' int s[101]; ^ componenteconexe1.cpp:11:5: error: 'int s [101]' previously declared here int s[101]; ^ componenteconexe1.cpp:196:5: error: redefinition of 'int k' int k; ^ componenteconexe1.cpp:12:5: error: 'int k' previously declared here int k; ^ componenteconexe1.cpp:197:12: error: redefinition of 'int sol [101]' int sol[101]; ^ componenteconexe1.cpp:13:5: error: 'int sol [101]' previously declared here int sol[101]; ^ componenteconexe1.cpp: In function 'void citire()': componenteconexe1.cpp:199:6: error: redefinition of 'void citire()' void citire() ^ componenteconexe1.cpp:15:6: error: 'void citire()' previously defined here void citire() ^ componenteconexe1.cpp: In function 'void dfs(int)': componenteconexe1.cpp:209:6: error: redefinition of 'void dfs(int)' void dfs(int nod) ^ componenteconexe1.cpp:25:6: error: 'void dfs(int)' previously defined here void dfs(int nod) ^ componenteconexe1.cpp: In function 'int main()': componenteconexe1.cpp:217:5: error: redefinition of 'int main()' int main() ^ componenteconexe1.cpp:33:5: error: 'int main()' previously defined here int main() ^ componenteconexe1.cpp: At global scope: componenteconexe1.cpp:236:13: error: redefinition of 'std::ifstream fin' ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:6:10: error: 'std::ifstream fin' previously declared here ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:237:14: error: redefinition of 'std::ofstream fout' ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:7:10: error: 'std::ofstream fout' previously declared here ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:239:5: error: redefinition of 'int n' int n, tot; ^ componenteconexe1.cpp:9:5: error: 'int n' previously declared here int n, tot; ^ componenteconexe1.cpp:239:8: error: redefinition of 'int tot' int n, tot; ^ componenteconexe1.cpp:9:8: error: 'int tot' previously declared here int n, tot; ^ componenteconexe1.cpp:240:15: error: redefinition of 'int v [101][101]' int v[101][101]; ^ componenteconexe1.cpp:10:5: error: 'int v [101][101]' previously declared here int v[101][101]; ^ componenteconexe1.cpp:241:10: error: redefinition of 'int s [101]' int s[101]; ^ componenteconexe1.cpp:11:5: error: 'int s [101]' previously declared here int s[101]; ^ componenteconexe1.cpp:242:5: error: redefinition of 'int k' int k; ^ componenteconexe1.cpp:12:5: error: 'int k' previously declared here int k; ^ componenteconexe1.cpp:243:12: error: redefinition of 'int sol [101]' int sol[101]; ^ componenteconexe1.cpp:13:5: error: 'int sol [101]' previously declared here int sol[101]; ^ componenteconexe1.cpp: In function 'void citire()': componenteconexe1.cpp:245:6: error: redefinition of 'void citire()' void citire() ^ componenteconexe1.cpp:15:6: error: 'void citire()' previously defined here void citire() ^ componenteconexe1.cpp: In function 'void dfs(int)': componenteconexe1.cpp:255:6: error: redefinition of 'void dfs(int)' void dfs(int nod) ^ componenteconexe1.cpp:25:6: error: 'void dfs(int)' previously defined here void dfs(int nod) ^ componenteconexe1.cpp: In function 'int main()': componenteconexe1.cpp:263:5: error: redefinition of 'int main()' int main() ^ componenteconexe1.cpp:33:5: error: 'int main()' previously defined here int main() ^ componenteconexe1.cpp: At global scope: componenteconexe1.cpp:282:13: error: redefinition of 'std::ifstream fin' ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:6:10: error: 'std::ifstream fin' previously declared here ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:283:14: error: redefinition of 'std::ofstream fout' ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:7:10: error: 'std::ofstream fout' previously declared here ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:285:5: error: redefinition of 'int n' int n, tot; ^ componenteconexe1.cpp:9:5: error: 'int n' previously declared here int n, tot; ^ componenteconexe1.cpp:285:8: error: redefinition of 'int tot' int n, tot; ^ componenteconexe1.cpp:9:8: error: 'int tot' previously declared here int n, tot; ^ componenteconexe1.cpp:286:15: error: redefinition of 'int v [101][101]' int v[101][101]; ^ componenteconexe1.cpp:10:5: error: 'int v [101][101]' previously declared here int v[101][101]; ^ componenteconexe1.cpp:287:10: error: redefinition of 'int s [101]' int s[101]; ^ componenteconexe1.cpp:11:5: error: 'int s [101]' previously declared here int s[101]; ^ componenteconexe1.cpp:288:5: error: redefinition of 'int k' int k; ^ componenteconexe1.cpp:12:5: error: 'int k' previously declared here int k; ^ componenteconexe1.cpp:289:12: error: redefinition of 'int sol [101]' int sol[101]; ^ componenteconexe1.cpp:13:5: error: 'int sol [101]' previously declared here int sol[101]; ^ componenteconexe1.cpp: In function 'void citire()': componenteconexe1.cpp:291:6: error: redefinition of 'void citire()' void citire() ^ componenteconexe1.cpp:15:6: error: 'void citire()' previously defined here void citire() ^ componenteconexe1.cpp: In function 'void dfs(int)': componenteconexe1.cpp:301:6: error: redefinition of 'void dfs(int)' void dfs(int nod) ^ componenteconexe1.cpp:25:6: error: 'void dfs(int)' previously defined here void dfs(int nod) ^ componenteconexe1.cpp: In function 'int main()': componenteconexe1.cpp:309:5: error: redefinition of 'int main()' int main() ^ componenteconexe1.cpp:33:5: error: 'int main()' previously defined here int main() ^ componenteconexe1.cpp: At global scope: componenteconexe1.cpp:328:13: error: redefinition of 'std::ifstream fin' ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:6:10: error: 'std::ifstream fin' previously declared here ifstream fin("componenteconexe1.in"); ^ componenteconexe1.cpp:329:14: error: redefinition of 'std::ofstream fout' ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:7:10: error: 'std::ofstream fout' previously declared here ofstream fout("componenteconexe1.out"); ^ componenteconexe1.cpp:331:5: error: redefinition of 'int n' int n, tot; ^ componenteconexe1.cpp:9:5: error: 'int n' previously declared here int n, tot; ^ componenteconexe1.cpp:331:8: error: redefinition of 'int tot' int n, tot; ^ componenteconexe1.cpp:9:8: error: 'int tot' previously declared here int n, tot; ^ componenteconexe1.cpp:332:15: error: redefinition of 'int v [101][101]' int v[101][101]; ^ componenteconexe1.cpp:10:5: error: 'int v [101][101]' previously declared here int v[101][101]; ^ componenteconexe1.cpp:333:10: error: redefinition of 'int s [101]' int s[101]; ^ componenteconexe1.cpp:11:5: error: 'int s [101]' previously declared here int s[101]; ^ componenteconexe1.cpp:334:5: error: redefinition of 'int k' int k; ^ componenteconexe1.cpp:12:5: error: 'int k' previously declared here int k; ^ componenteconexe1.cpp:335:12: error: redefinition of 'int sol [101]' int sol[101]; ^ componenteconexe1.cpp:13:5: error: 'int sol [101]' previously declared here int sol[101]; ^ componenteconexe1.cpp: In function 'void citire()': componenteconexe1.cpp:337:6: error: redefinition of 'void citire()' void citire() ^ componenteconexe1.cpp:15:6: error: 'void citire()' previously defined here void citire() ^ componenteconexe1.cpp: In function 'void dfs(int)': componenteconexe1.cpp:347:6: error: redefinition of 'void dfs(int)' void dfs(int nod) ^ componenteconexe1.cpp:25:6: error: 'void dfs(int)' previously defined here void dfs(int nod) ^ componenteconexe1.cpp: In function 'int main()': componenteconexe1.cpp:355:5: error: redefinition of 'int main()' int main() ^ componenteconexe1.cpp:33:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe1 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ă.