add vector

This commit is contained in:
csyer
2024-02-22 19:53:46 +08:00
parent b648f3923d
commit d65c91fee8
24 changed files with 3974 additions and 2 deletions

1025
vector/data/two/answer.txt Normal file

File diff suppressed because it is too large Load Diff

22
vector/data/two/code.cpp Normal file
View File

@ -0,0 +1,22 @@
#include "vector.hpp"
#include <iostream>
#include <vector>
int main()
{
sjtu::vector<long long> v;
for (long long i = 0; i < 1LL << 20; ++i) {
v.push_back(i);
}
std::cout << v.back() << std::endl;
for (long long i = 0; i < 1LL << 11; ++i) {
v.insert(v.begin(), i);
}
for (size_t i = 0; i < 1LL << 10; ++i) {
std::cout << v.front() << std::endl;
v.erase(v.begin());
}
return 0;
}