#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 | #50724421 | Utilizator | |
Fișier | conex.cpp | Dimensiune | 451 B |
Data încărcării | 25 Aprilie 2024, 11:22 | Scor / rezultat | Eroare de compilare |
conex.cpp:2:1: error: 'vusing' does not name a type vusing namespace std; ^ conex.cpp:3:1: error: 'ifstream' does not name a type ifstream cin("conex.in"); ^ conex.cpp:4:1: error: 'ofstream' does not name a type ofstream cout("conex.out"); ^ conex.cpp: In function 'void dfs(int)': conex.cpp:7:5: error: 'v' was not declared in this scope v[x] = 1; ^ conex.cpp:8:26: error: 'n' was not declared in this scope for(int i = 1 ; i <= n ; i++) ^ conex.cpp:9:21: error: 'a' was not declared in this scope if(!v[i] && a[x][i] == 1) dfs(i) , v[i] = 1; ^ conex.cpp: In function 'int main()': conex.cpp:13:5: error: 'cin' was not declared in this scope cin >> n; ^ conex.cpp:13:5: note: suggested alternative: In file included from conex.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ conex.cpp:13:12: error: 'n' was not declared in this scope cin >> n; ^ conex.cpp:14:18: error: 'x' was not declared in this scope while(cin >> x >> y) a[x][y] = a[y][x] = 1 , m++; ^ conex.cpp:14:23: error: 'y' was not declared in this scope while(cin >> x >> y) a[x][y] = a[y][x] = 1 , m++; ^ conex.cpp:14:26: error: 'a' was not declared in this scope while(cin >> x >> y) a[x][y] = a[y][x] = 1 , m++; ^ conex.cpp:14:50: error: 'm' was not declared in this scope while(cin >> x >> y) a[x][y] = a[y][x] = 1 , m++; ^ conex.cpp:16:32: error: 'ok' was not declared in this scope for(int i = 1 ; i <= n && !ok; i++) ^ conex.cpp:17:12: error: 'v' was not declared in this scope if(v[i] == 0) ok++; ^ conex.cpp:18:8: error: 'ok' was not declared in this scope if(ok != 0) cout << "NU"; ^ conex.cpp:18:17: error: 'cout' was not declared in this scope if(ok != 0) cout << "NU"; ^ conex.cpp:18:17: note: suggested alternative: In file included from conex.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ conex.cpp:19:10: error: 'cout' was not declared in this scope else cout << "DA"; ^ conex.cpp:19:10: note: suggested alternative: In file included from conex.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^
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ă.