#include <vector>
#include <iostream>
using namespace std;
int main() {
vector<int> v{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
for (auto &i : v) {
cout << i << " ";
}
cout << '\n';
for (int k = 0; k <= 10; k++) {
for (int i = 0; i < v.size(); i++) {
if (v[i] == k) {
v.erase(v.begin() + i);
break;
}
}
}
for (auto &i : v) {
cout << i << " ";
}
cout << '\n';
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpIHsKICAgIHZlY3RvcjxpbnQ+IHZ7IDAsIDEsIDIsIDMsIDQsIDUsIDYsIDcsIDgsIDkgfTsKICAgIGZvciAoYXV0byAmaSA6IHYpIHsKICAgICAgICBjb3V0IDw8IGkgPDwgIiAiOwogICAgfQogICAgY291dCA8PCAnXG4nOwogICAgZm9yIChpbnQgayA9IDA7IGsgPD0gMTA7IGsrKykgewoJICAgIGZvciAoaW50IGkgPSAwOyBpIDwgdi5zaXplKCk7IGkrKykgewoJICAgICAgICBpZiAodltpXSA9PSBrKSB7CgkgICAgICAgICAgICB2LmVyYXNlKHYuYmVnaW4oKSArIGkpOwoJICAgICAgICAgICAgYnJlYWs7CgkgICAgICAgIH0KCSAgICB9CiAgICB9CiAgICBmb3IgKGF1dG8gJmkgOiB2KSB7CiAgICAgICAgY291dCA8PCBpIDw8ICIgIjsKICAgIH0KICAgIGNvdXQgPDwgJ1xuJzsKfQ==