#867
Se dau patru numere naturale n a x y
. Să se afișeze elementele mulțimii M
, cu următoarele proprietăți:
M
sunt numere naturale mai mici sau egale cu n
;a
se află în M
;b
se află în M
, atunci b+x
și b+y
se află în M
.Problema | Generare2_cu_Coada | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56717395 | Utilizator | |
Fișier | generare2_cu_coada.cpp | Dimensiune | 720 B |
Data încărcării | 03 Martie 2025, 19:57 | Scor / rezultat | Eroare de compilare |
generare2_cu_coada.cpp: In function 'int main()': generare2_cu_coada.cpp:12:7: error: 'class std::queue<int>' has no member named 'push_back' q.push_back(a); ^ generare2_cu_coada.cpp:14:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while(++cnt < q.size()){ ^ generare2_cu_coada.cpp:15:14: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int') if( q[cnt] + x <= n && !apartine[q[cnt]+ x]){ ^ generare2_cu_coada.cpp:15:43: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int') if( q[cnt] + x <= n && !apartine[q[cnt]+ x]){ ^ generare2_cu_coada.cpp:16:15: error: 'class std::queue<int>' has no member named 'push_back' q.push_back(q[cnt] + x); ^ generare2_cu_coada.cpp:16:26: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int') q.push_back(q[cnt] + x); ^ generare2_cu_coada.cpp:17:23: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int') apartine[q[cnt]+ x] = true; ^ generare2_cu_coada.cpp:19:14: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int') if( q[cnt] + y <= n && !apartine[q[cnt]+ y]){ ^ generare2_cu_coada.cpp:19:43: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int') if( q[cnt] + y <= n && !apartine[q[cnt]+ y]){ ^ generare2_cu_coada.cpp:20:15: error: 'class std::queue<int>' has no member named 'push_back' q.push_back(q[cnt] + y); ^ generare2_cu_coada.cpp:20:26: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int') q.push_back(q[cnt] + y); ^ generare2_cu_coada.cpp:21:23: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int') apartine[q[cnt]+ y] = true; ^ generare2_cu_coada.cpp:24:12: error: 'class std::queue<int>' has no member named 'begin' sort(q.begin(), q.end()); ^ generare2_cu_coada.cpp:24:23: error: 'class std::queue<int>' has no member named 'end' sort(q.begin(), q.end()); ^ generare2_cu_coada.cpp:27:11: error: 'class std::queue<int>' has no member named 'pop_front' q.pop_front(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Generare2_cu_Coada 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ă.