Quick sort problem 1

question https://hack.codingblocks.com/contests/c/512/389
#include
using namespace std;
int partition(long long int a[],int s,int e){
int j=s;
int i=s-1;
for ( ;j<e;j++){
if(a[j]<a[e]){
i++;
swap(a[i],a[j]);
}
}
swap(a[i+1],a[e]);
return i+1;
}
void quicksort (long long int a[],int s,int e){
if(s>=e){
return ;
}
int p = partition(a,s,e);
quicksort(a,s,p-1);
quicksort(a,p+1,e);
}
int main() {
long long int a[1000005];
long long int n;
cin>>n;
for (int i=0;i<n;i++){
cin>>a[i];
}
quicksort(a,0,n-1);
for(int i=0;i<n;i++){
cout<<a[i]<<" ";
}
return 0;
}

test case no. 3 showing time limit exceded and other test cases passed

Hi Sarthak, you have to use randomized quicksort in this question otherwise you will get TLE error.

The third test case is passing in https://ide.codingblocks.com/s/55203
but not with https://ide.codingblocks.com/s/55202
and shows TLE with https://ide.codingblocks.com/s/55206
although I have used randomization in all of them.
Please explain