蒟蒻的疑问

学术版

直接使用 `remove_if`,复杂度线性。
by reveal @ 2022-11-25 16:58:11


```c++ remove_if(a.begin(),a.end(),value) ``` 可见 [cppreference](https://zh.cppreference.com/w/cpp/algorithm/remove)。
by reveal @ 2022-11-25 17:01:03


@[_Igallta_](/user/349736) ```cpp for(auto it=a.begin();it!=a.end();it++) { if(*it==要查找的元素) { a.erase(it); } } ```
by LeNotFound @ 2022-11-25 17:01:08


|