Why m I getting TLE in Power Set?

I am trying to solve this problem … but the algorithm i implement gives TLE :frowning:

This is what i tried to implement => https://www.codechef.com/viewplaintext/9848187

Please provide solution.

As you have requested only solution then here you go
sum=0;array[];
for(i=0;i < n;i++){
sum+=array[i];
}
answer= sum*power(2,n-1);

Can you please point out mistake in this algo => CodeChef: Practical coding for everyone
Seems i implemented what you said :frowning:

Please provide the code :slight_smile: @admin123

sum of all elements of all the subsets in power set - Codeforces?
look at this same question has been asked and candidate master answered the same.