Array Declaration

How to declare an array of unknown size in c++ if given range of size is very high?

you must use vectors which will dynamically allocate memory for array and size of array is also taken at runtime.
check this out:- https://www.geeksforgeeks.org/vector-in-cpp-stl/

can you post question link pls? or tell the max size of array you want?

this code is fine ,error must be due to some other part of code.
you can use this

long long int A[m],i;
for(i=0;i<m;++i)
{
cin>>A[i];
}

this should work fine according to me

you can’t ask anything related to on going contest ,you may be banned for this .it’s against codechef guidelines .you must remember this from now onwards

your ouput is printed in every test case so you don’t need that particular array again , for new values of n and m ,new array is required hence A is redeclared accordingly or overwritten. i can’t tell you anything else ,you must follow this

long challenges are for making you learn by yourself, it would benifit you more if you will try to exploit it by your own ,keep motivated and keep going.

there are ‘…’ three dots on bottom right of post ,press on it you will find it

lol i asked to delete post ,you are deleting comments:sweat_smile::rofl: