i don't understand the subtask

in Pairwise AND sum problem from school catagory there are sub tasks like
Subtask 1 (13 points): N <= 1000, Ai <= 1.

Subtask 2 (39 points): N <= 1000, Ai <= 109.

Subtask 3 (21 points): N <= 105, Ai <= 1.

Subtask 4 (27 points): N <= 105, Ai <= 106.

my code is
#include <stdio.h>
int main()
{
long long int n,i,m,x,j;
scanf("%lld", &n);
long long int ara[n+1];

for(i = 0;i<n;i++)
	scanf("%lld", &ara[i]);

m = 0;
for(i=0;i<n;i++) {
	for(j=0;j<n;j++) {
		if(ara[i] < ara[j])
		m = m + (ara[i]&ara[j]);
	}
}
	
printf("%lld\n",m);

return 0;

}

it shows i’ve only done sub task 2 … others are not done … i don’t understand why.can anyone plz tell me about this.i am new.

Here your logic is O(n^2) and for n<=10^5 it is definately going to give time limit exceeded. so your 3 and 4 subtasks are TLE’d. So try to optimize your solution. http://www.codechef.com/viewsolution/4369768
here you can see summary of your submission.