#4960
Se dă un graf neorientat cu n noduri și două numere naturale p q. Să se determine nodurile din graf care au gradul între p și q.
| Problema | GradePQ | Operații I/O |
gradepq.in/gradepq.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64979138 | Utilizator | |
| Fișier | gradepq.cpp | Dimensiune | 656 B |
| Data încărcării | 02 Iulie 2026, 10:41 | Scor/rezultat | Eroare de compilare |
gradepq.cpp:6:19: error: conflicting declaration ‘int g [102]’ 6 | int n,a[101][101],g[102],k,p,q; | ^ gradepq.cpp:5:10: note: previous declaration as ‘std::ofstream g’ 5 | ofstream g("gradepq.out"); | ^ gradepq.cpp: In function ‘int main()’: gradepq.cpp:17:10: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 17 | g[i]=0; | ^ gradepq.cpp:18:13: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 18 | if(g[i]>g[p] && g[i]<g[q]) | ^ gradepq.cpp:18:18: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 18 | if(g[i]>g[p] && g[i]<g[q]) | ^ gradepq.cpp:18:26: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 18 | if(g[i]>g[p] && g[i]<g[q]) | ^ gradepq.cpp:18:31: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 18 | if(g[i]>g[p] && g[i]<g[q]) | ^ gradepq.cpp:19:14: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 19 | g[i]++; | ^ gradepq.cpp:23:13: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 23 | if(g[i]>g[p] && g[i]<g[q]) | ^ gradepq.cpp:23:18: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 23 | if(g[i]>g[p] && g[i]<g[q]) | ^ gradepq.cpp:23:26: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 23 | if(g[i]>g[p] && g[i]<g[q]) | ^ gradepq.cpp:23:31: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 23 | if(g[i]>g[p] && g[i]<g[q]) | ^ gradepq.cpp:29:10: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 29 | {if(g[i]>g[p] && g[i]<g[q]) | ^ gradepq.cpp:29:15: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 29 | {if(g[i]>g[p] && g[i]<g[q]) | ^ gradepq.cpp:29:23: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 29 | {if(g[i]>g[p] && g[i]<g[q]) | ^ gradepq.cpp:29:28: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 29 | {if(g[i]>g[p] && g[i]<g[q]) | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GradePQ 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ă.