#419
Subgraf1
Se dă lista muchiilor unui graf neorientat cu n
vârfuri, etichetate de la 1
la n
. Din acest graf se elimină toate vârfurile care au gradul minim. Să se determine câte muchii va avea subgraful obținut.
Problema | Subgraf1 | Operații I/O |
subgraf1.in /subgraf1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #48660145 | Utilizator | |
Fișier | subgraf1.cpp | Dimensiune | 1.18 KB |
Data încărcării | 01 Februarie 2024, 11:25 | Scor / rezultat | Eroare de compilare |
subgraf1.cpp:4:16: warning: missing terminating " character [enabled by default] ofstream g("subgraf1.out); ^ subgraf1.cpp:4:5: error: missing terminating " character ofstream g("subgraf1.out); ^ subgraf1.cpp:3:11: error: variable 'std::ifstream f' has initializer but incomplete type ifstream f("subgraf1.in"); ^ subgraf1.cpp:5:32: error: 'n' has not been declared int a[105][105],n,x,y; ^ subgraf1.cpp:5:34: error: 'x' has not been declared int a[105][105],n,x,y; ^ subgraf1.cpp:5:36: error: 'y' has not been declared int a[105][105],n,x,y; ^ subgraf1.cpp:5:37: error: expected ')' before ';' token int a[105][105],n,x,y; ^ subgraf1.cpp: In function 'int main()': subgraf1.cpp:8:23: error: 'n' was not declared in this scope f>>n; ^ subgraf1.cpp:9:29: error: 'x' was not declared in this scope while(f>>x>y) ^ subgraf1.cpp:9:31: error: 'y' was not declared in this scope while(f>>x>y) ^ subgraf1.cpp:10:24: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ subgraf1.cpp:16:38: error: 'a' was not declared in this scope grad=grad+a[i][j]; ^ subgraf1.cpp:23:38: error: 'a' was not declared in this scope grad>grad+a[i][j]; ^ subgraf1.cpp:26:28: error: 'a' was not declared in this scope a[i][k]=a[k][i]=0; ^ subgraf1.cpp:31:28: error: 'a' was not declared in this scope m=m+a[i][j]; ^ subgraf1.cpp:32:27: error: invalid operands of types 'std::ofstream(int (*)[105], int, int, int) {aka std::basic_ofstream<char>(int (*)[105], int, int, int)}' and 'int' to binary 'operator<<' g<<m; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Subgraf1 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ă.