fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. vector<int> vec;
  6. for(int i=0;i<100000;i++)
  7. vec.push_back(5);
  8. int l = vec.size();
  9. for(int i=0;i<vec.size();i++)
  10. {
  11. if(vec[i]==5)
  12. {
  13. vec.erase(vec.begin()+i);
  14. i=0;
  15. }
  16. }
  17. cout << vec.size() << endl;
  18. cout << "Done" << endl;
  19. return 0;
  20. }
Success #stdin #stdout 0.46s 16064KB
stdin
Standard input is empty
stdout
1
Done