#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 | #52423670 | Utilizator | |
Fișier | graf_partial_1.cpp | Dimensiune | 866 B |
Data încărcării | 29 Septembrie 2024, 22:41 | Scor / rezultat | Eroare de compilare |
graf_partial_1.cpp:2:20: error: found ':' in nested-name-specifier, expected '::' using namespace std: ^ graf_partial_1.cpp:3:1: error: 'ifstream' is not a namespace-name ifstream fin("graf_partial_1.in"); ^ graf_partial_1.cpp:3:10: error: expected namespace-name before 'fin' ifstream fin("graf_partial_1.in"); ^ graf_partial_1.cpp:3:10: error: expected ';' before 'fin' graf_partial_1.cpp:3:13: error: expected constructor, destructor, or type conversion before '(' token ifstream fin("graf_partial_1.in"); ^ graf_partial_1.cpp:4:1: error: 'ofstream' does not name a type ofstream fout("graf_partial_1.out") ^ graf_partial_1.cpp: In function 'int main()': graf_partial_1.cpp:9:4: error: 'fin' was not declared in this scope fin>>n; ^ graf_partial_1.cpp:9:9: error: 'n' was not declared in this scope fin>>n; ^ graf_partial_1.cpp:10:15: error: 'x' was not declared in this scope while(fin>>x>>y) ^ graf_partial_1.cpp:10:18: error: 'y' was not declared in this scope while(fin>>x>>y) ^ graf_partial_1.cpp:11:6: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ graf_partial_1.cpp:12:10: error: 'a' was not declared in this scope if(!a[x][y]){ ^ graf_partial_1.cpp:12:12: error: 'x' was not declared in this scope if(!a[x][y]){ ^ graf_partial_1.cpp:12:15: error: 'y' was not declared in this scope if(!a[x][y]){ ^ graf_partial_1.cpp:13:10: error: 'v' was not declared in this scope v[x]++; ^ graf_partial_1.cpp:17:16: error: 'v' was not declared in this scope if(mn>v[i]) mn=v[i]; ^ graf_partial_1.cpp:19:16: error: 'v' was not declared in this scope if(mx<v[i]) mx=v[i]; ^ graf_partial_1.cpp:25:4: error: 'v' was not declared in this scope if(v[i]==mn)|{ ^ graf_partial_1.cpp:25:13: error: expected primary-expression before '|' token if(v[i]==mn)|{ ^ graf_partial_1.cpp:25:14: error: expected primary-expression before '{' token if(v[i]==mn)|{ ^ graf_partial_1.cpp:25:14: error: expected ';' before '{' token graf_partial_1.cpp:45:1: error: expected '}' at end of input } ^ graf_partial_1.cpp:45:1: error: expected '}' at end of input
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ă.