#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 | #64979157 | Utilizator | |
| Fișier | gradepq.cpp | Dimensiune | 719 B |
| Data încărcării | 02 Iulie 2026, 10:46 | Scor/rezultat | Eroare de compilare |
gradepq.cpp:7:19: error: conflicting declaration ‘int g [102]’ 7 | int n,a[101][101],g[102],p,q; | ^ gradepq.cpp:6:10: note: previous declaration as ‘std::ofstream g’ 6 | ofstream g("gradepq.out"); | ^ gradepq.cpp: In function ‘int main()’: gradepq.cpp:14:10: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 14 | g[i]++; | ^ gradepq.cpp:15:10: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 15 | g[j]++; | ^ gradepq.cpp:20:14: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 20 | if (g[i]>=p && g[i]<=q) | ^ gradepq.cpp:20:25: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 20 | if (g[i]>=p && g[i]<=q) | ^ gradepq.cpp:35:18: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 35 | if (g[i]>=p && g[i]<=q) | ^ gradepq.cpp:35:29: error: no match for ‘operator[]’ (operand types are ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} and ‘int’) 35 | if (g[i]>=p && g[i]<=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ă.