i tries long long but it wasnt working.
can you send me a code for similar?
How to get take 1000000000 elements in array
Hi @premang
u do no require to use a array
since u just need to find the max element
u can simply use long long int to insert the number
find max using stl max( prevMax , x)
pseudo code :
int maxVal = INT_MIN;
ll x;
int n ;
cin >> n;for(int i = 0 ; i < n ; i++) {
cin >> x;
maxVal = max(maxVal , x ) ;
}
cout << maxVal;