#421
Graf Partial 1
Se dă lista muchiilor unui graf neorientat cu n
vârfuri, etichetate de la 1
la n
. Din acest graf se elimină toate muchiile cu o extremitate de grad maxim și cealaltă extremitate de grad minim. Să se determine numărul de muchii eliminate și să se afișeze matricea de adiacență a grafului parțial obținut.
Problema | Graf Partial 1 | Operații I/O |
graf_partial_1.in /graf_partial_1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52313100 | Utilizator | |
Fișier | graf_partial_1.cpp | Dimensiune | 553 B |
Data încărcării | 26 Septembrie 2024, 09:54 | Scor / rezultat | Eroare de compilare |
graf_partial_1.cpp:5:9: error: expected unqualified-id before string constant fstream("graf_partial_1.in"); ^ graf_partial_1.cpp:5:9: error: expected ')' before string constant graf_partial_1.cpp:6:10: error: expected unqualified-id before string constant ofstream("graf_partial_1.out"); ^ graf_partial_1.cpp:6:10: error: expected ')' before string constant graf_partial_1.cpp: In function 'int main()': graf_partial_1.cpp:10:5: error: 'fin' was not declared in this scope fin>>n>>m; ^ graf_partial_1.cpp:10:10: error: 'n' was not declared in this scope fin>>n>>m; ^ graf_partial_1.cpp:10:13: error: 'm' was not declared in this scope fin>>n>>m; ^ graf_partial_1.cpp:11:9: error: 'i' was not declared in this scope for(i=1; i<=m; i++) ^ graf_partial_1.cpp:13:14: error: 'x' was not declared in this scope fin>>x>>y; ^ graf_partial_1.cpp:13:17: error: 'y' was not declared in this scope fin>>x>>y; ^ graf_partial_1.cpp:14:9: error: 'a' was not declared in this scope a[x][y]=0; ^ graf_partial_1.cpp:17:5: error: 'dmin' was not declared in this scope dmin= n+1; ^ graf_partial_1.cpp:18:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ graf_partial_1.cpp:20:12: error: 'd' was not declared in this scope if(d[i]<dmin) ^ graf_partial_1.cpp:22:12: error: 'd' was not declared in this scope if(d[i]>dmax) ^ graf_partial_1.cpp:22:17: error: 'dmax' was not declared in this scope if(d[i]>dmax) ^ graf_partial_1.cpp:25:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ graf_partial_1.cpp:26:13: error: 'j' was not declared in this scope for(j=1; j<=m; j++) ^ graf_partial_1.cpp:27:9: error: 'fout' was not declared in this scope fout<<d[x]=dmin<<' '<<d[y]=dmax<<' '; ^ graf_partial_1.cpp:27:15: error: 'd' was not declared in this scope fout<<d[x]=dmin<<' '<<d[y]=dmax<<' '; ^ graf_partial_1.cpp:27:17: error: 'x' was not declared in this scope fout<<d[x]=dmin<<' '<<d[y]=dmax<<' '; ^ graf_partial_1.cpp:27:33: error: 'y' was not declared in this scope fout<<d[x]=dmin<<' '<<d[y]=dmax<<' '; ^ graf_partial_1.cpp:27:36: error: 'dmax' was not declared in this scope fout<<d[x]=dmin<<' '<<d[y]=dmax<<' '; ^ graf_partial_1.cpp:28:5: error: 'else' without a previous 'if' else ^ graf_partial_1.cpp:29:9: error: 'fout' was not declared in this scope fout<<d[x]=dmax<<' '<<d[y]=dmin<<' '; ^ graf_partial_1.cpp:29:15: error: 'd' was not declared in this scope fout<<d[x]=dmax<<' '<<d[y]=dmin<<' '; ^ graf_partial_1.cpp:29:17: error: 'x' was not declared in this scope fout<<d[x]=dmax<<' '<<d[y]=dmin<<' '; ^ graf_partial_1.cpp:29:20: error: 'dmax' was not declared in this scope fout<<d[x]=dmax<<' '<<d[y]=dmin<<' '; ^ graf_partial_1.cpp:29:33: error: 'y' was not declared in this scope fout<<d[x]=dmax<<' '<<d[y]=dmin<<' '; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Graf Partial 1 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ă.