I have written a code which has 2-D vectors as components. Whenever I give my input, after 1/2 seconds it shows this error 

```
"Terminate called after throwing an instance of ‘std::bad_alloc’ 
What(): std::bad_alloc

This application has requested the Runtime to terminate it in an unusual way. 
Please contact the application’s support team for more information."

```

And after that my PC slows down and the code returns an integer and until I close the .exe file it never regains its speed. 

What is the reason behind this? How to avoid such errors?\
My code is <http://paste.ubuntu.com/6593192/>