Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using ssize_t = signed long long;
- using size_t = unsigned long long;
- using int32_t = int;
- class MyVector {
- private:
- size_t size_ = 0;
- size_t capacity_ = 0;
- int32_t* arr_ = nullptr;
- public:
- MyVector();
- MyVector(size_t n);
- MyVector(size_t n, int32_t value);
- ~MyVector();
- MyVector(const MyVector& other);
- MyVector& operator=(const MyVector& other);
- size_t Size() const;
- size_t Capacity() const;
- void Read(size_t n);
- void PrintSize() const;
- void Print() const;
- void PushBack(int32_t x);
- int32_t PopBack();
- void Clear();
- void Insert(int32_t x, size_t k);
- void Erase(size_t k);
- void Resize(size_t new_size);
- void Reserve(size_t new_cap);
- int32_t& operator[](ssize_t index);
- const int32_t& operator[](size_t index) const;
- MyVector& operator^=(const MyVector &other);
- int32_t Max() const;
- int32_t Min() const;
- long long Sum() const;
- long double Mean() const;
- };
Advertisement
Add Comment
Please, Sign In to add comment