#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 | #9638882 | Utilizator | |
Fișier | graf_partial_1.cpp | Dimensiune | 943 B |
Data încărcării | 18 Mai 2018, 11:44 | Scor / rezultat | Eroare de compilare |
graf_partial_1.cpp:8:24: error: conflicting declaration 'int g [101]' int a[101][101],n,g[101],gmax,gmin; ^ graf_partial_1.cpp:7:10: error: 'g' has a previous declaration as 'std::ofstream g' ofstream g("graf_partial_1.out"); ^ graf_partial_1.cpp: In function 'void grade()': graf_partial_1.cpp:29:7: error: no match for 'operator[]' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') g[i]=0; ^ graf_partial_1.cpp:31:5: error: no match for 'operator[]' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') g[i]=g[i]+a[i][j]; ^ graf_partial_1.cpp:31:10: error: no match for 'operator[]' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') g[i]=g[i]+a[i][j]; ^ graf_partial_1.cpp:32:7: error: no match for 'operator[]' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') if(g[i]<gmin) ^ graf_partial_1.cpp:33:10: error: no match for 'operator[]' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') gmin=g[i]; ^ graf_partial_1.cpp:34:7: error: no match for 'operator[]' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') if(g[i]>gmax) ^ graf_partial_1.cpp:35:10: error: no match for 'operator[]' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') gmax=g[i]; ^ graf_partial_1.cpp: In function 'void elimina()': graf_partial_1.cpp:46:21: error: no match for 'operator[]' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') if(g[i]==gmax && g[j]==gmin || g[i]==gmin && g[j]==gmax) ^ graf_partial_1.cpp:46:35: error: no match for 'operator[]' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') if(g[i]==gmax && g[j]==gmin || g[i]==gmin && g[j]==gmax) ^ graf_partial_1.cpp:46:49: error: no match for 'operator[]' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') if(g[i]==gmax && g[j]==gmin || g[i]==gmin && g[j]==gmax) ^ graf_partial_1.cpp:46:63: error: no match for 'operator[]' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') if(g[i]==gmax && g[j]==gmin || g[i]==gmin && g[j]==gmax) ^
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ă.