How to store this much in array?

How to store 10^9 elements in array or vecor?

Can it be stored?

What to use if i have to store 10^9 elements in an array?

10^9 array cannot be made and there is no alternative to that, better to change your approach.


Can you please specify the question for which you need 10^9 array elements?
I mean there are many other alternatives you can easily use according to the question requirement i.e., co-ordinate compression, unordered_map<>, map<> etc.

1 Like

problem code: ppnum

I saw your question on discuss-form.You cannot create an array of such big size. The same is with co-ordinate compression, unordered_map<>, map<> . Better change the approach.