#3534
Multiset_OOP
C++
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 multisetProblema | 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 | #23650613 | Utilizator | |
Fișier | multiset_oop.cpp | Dimensiune | 1.25 KB |
Data încărcării | 11 August 2020, 12:05 | Scor / rezultat | Eroare de compilare |
multiset_oop.cpp:24:5: error: 'Vi' does not name a type Vi Bit; ^ multiset_oop.cpp: In constructor 'BIT::BIT(const int&)': multiset_oop.cpp:7:9: error: 'Bit' was not declared in this scope Bit.resize (n + 1); ^ multiset_oop.cpp: In member function 'void BIT::update(int, const int&)': multiset_oop.cpp:11:13: error: 'Bit' was not declared in this scope Bit[index] += val, index += lsb (index); ^ multiset_oop.cpp: In member function 'int BIT::query(int)': multiset_oop.cpp:16:20: error: 'Bit' was not declared in this scope sum += Bit[index], index -= lsb (index); ^ multiset_oop.cpp: In destructor 'BIT::~BIT()': multiset_oop.cpp:20:13: error: 'Vi' was not declared in this scope Vi ().swap (Bit); ^ multiset_oop.cpp:20:21: error: 'Bit' was not declared in this scope Vi ().swap (Bit); ^ multiset_oop.cpp: In member function 'int Multiset::Find(int)': multiset_oop.cpp:44:37: error: 'class BIT' has no member named 'Bit' if (val + x <= n && Aib.Bit[val + x] < pos) ^ multiset_oop.cpp:45:28: error: 'class BIT' has no member named 'Bit' pos -= Aib.Bit[val + x], val += x; ^ multiset_oop.cpp: In member function 'int Multiset::log(const int&) const': multiset_oop.cpp:56:39: error: '__lzcnt' was not declared in this scope return 1 << (31 - __lzcnt (val)); ^ multiset_oop.cpp: In function 'int main()': multiset_oop.cpp:86:41: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("multiset_oop.in", "r", stdin); ^ multiset_oop.cpp:87:44: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("multiset_oop.out", "w", stdout); ^ multiset_oop.cpp: In member function 'int Multiset::log(const int&) const': multiset_oop.cpp:57:5: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.