fork download
  1. #include <vector>
  2.  
  3. void add(std::vector<int*>& v){
  4. int n=100000;
  5. v.reserve(n);
  6. for(int i=0; i<n; ++i){v.push_back(0);}
  7. }
  8. void erase(){
  9. std::vector<int*> xyz;
  10. add(xyz);
  11. while(!xyz.empty()){
  12. delete *xyz.begin();
  13. xyz.erase(xyz.begin());
  14. }
  15. }
  16. int main(){
  17. erase();
  18. return 0;
  19. }
Success #stdin #stdout 4.1s 2720KB
stdin
Standard input is empty
stdout
Standard output is empty