#437
Conex
Se dă lista muchiilor unui graf neorientat. Să se verifice dacă graful este sau nu conex.
Problema | Conex | Operații I/O |
conex.in /conex.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #40948316 | Utilizator | |
Fișier | conex.cpp | Dimensiune | 591 B |
Data încărcării | 05 Ianuarie 2023, 20:10 | Scor / rezultat | Eroare de compilare |
conex.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream fout("conex.out") ^ conex.cpp: In function 'void dfs(int)': conex.cpp:11:5: error: 'viz' was not declared in this scope viz[nodul] = 1; ^ conex.cpp:12:5: error: 'fout' was not declared in this scope fout << nodul << " "; ^ conex.cpp:14:25: error: 'n' was not declared in this scope for(int k = 1; k <= n; k++) ^ conex.cpp:15:12: error: 'a' was not declared in this scope if(a[nodul][k] == 1 && viz[k] == 0) ^ conex.cpp: In function 'int main()': conex.cpp:22:5: error: 'cin' was not declared in this scope cin >> n; ^ conex.cpp:22:12: error: 'n' was not declared in this scope cin >> n; ^ conex.cpp:23:18: error: 'x' was not declared in this scope while(cin >> x >> y) a[x][y] = a[y][x] = 1 , m++; ^ conex.cpp:23:23: error: 'y' was not declared in this scope while(cin >> x >> y) a[x][y] = a[y][x] = 1 , m++; ^ conex.cpp:23:26: error: 'a' was not declared in this scope while(cin >> x >> y) a[x][y] = a[y][x] = 1 , m++; ^ conex.cpp:23:50: error: 'm' was not declared in this scope while(cin >> x >> y) a[x][y] = a[y][x] = 1 , m++; ^ conex.cpp:25:32: error: 'ok' was not declared in this scope for(int i = 1 ; i <= n && !ok; i++) ^ conex.cpp:26:12: error: 'v' was not declared in this scope if(v[i] == 0) ok++; ^ conex.cpp:27:8: error: 'ok' was not declared in this scope if(ok != 0) cout << "NU"; ^ conex.cpp:27:17: error: 'cout' was not declared in this scope if(ok != 0) cout << "NU"; ^ conex.cpp:28:10: error: 'cout' was not declared in this scope else cout << "DA"; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Conex 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ă.