Can a vector store upto 499950000 integers in C++?

I am currently solving a problem in which I need store about that many elements. I can’t do that using arrays they can only store upto 10^7 elements. I have checked other sources but I haven’t got any precise answer yet. Can I use vectors or is there any other method of storing these many elements and accessing them?

No, you cannot store these many elements by any means. If memory limit is 256 MB, you are bound to get a run time error.

//