#3534
Definiți în C++ clasa Multiset care va implementa multiset-uri de numere naturale în care se definesc operațiile:
Insert(x) – inserează x în multisetErase(x) – elimină elementul de pe pozitia x din multisetFind(x) – returnează valoarea de pe pozitia x din multiset| Problema | Multiset_OOP | Operații I/O |
multiset_oop.in/multiset_oop.out
|
|---|---|---|---|
| Limita timp | 0.35 secunde | Limita memorie |
Total: 30 MB
/
Stivă 5 MB
|
| Id soluție | #64627940 | Utilizator | |
| Fișier | multiset_oop.cpp | Dimensiune | 1.17 KB |
| Data încărcării | 19 Mai 2026, 12:08 | Scor/rezultat | Eroare de compilare |
multiset_oop.cpp:100:5: error: redefinition of ‘int n’ 100 | int n, q, op, x; | ^ multiset_oop.cpp:50:5: note: ‘int n’ previously declared here 50 | int n, q, op, x; | ^ multiset_oop.cpp:100:8: error: redefinition of ‘int q’ 100 | int n, q, op, x; | ^ multiset_oop.cpp:50:8: note: ‘int q’ previously declared here 50 | int n, q, op, x; | ^ multiset_oop.cpp:100:11: error: redefinition of ‘int op’ 100 | int n, q, op, x; | ^~ multiset_oop.cpp:50:11: note: ‘int op’ previously declared here 50 | int n, q, op, x; | ^~ multiset_oop.cpp:100:15: error: redefinition of ‘int x’ 100 | int n, q, op, x; | ^ multiset_oop.cpp:50:15: note: ‘int x’ previously declared here 50 | int n, q, op, x; | ^ multiset_oop.cpp:101:5: error: redefinition of ‘int main()’ 101 | int main() | ^~~~ multiset_oop.cpp:51:5: note: ‘int main()’ previously defined here 51 | int main() | ^~~~ multiset_oop.cpp: In function ‘int main()’: multiset_oop.cpp:53:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 53 | freopen("multiset_oop.in", "r", stdin); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ multiset_oop.cpp:54:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 54 | freopen("multiset_oop.out", "w", stdout); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ multiset_oop.cpp: In function ‘int main()’: multiset_oop.cpp:103:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 103 | freopen("multiset_oop.in", "r", stdin); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ multiset_oop.cpp:104:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 104 | freopen("multiset_oop.out", "w", stdout); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Multiset_OOP face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.