You are viewing a single comment's thread. Return to all comments →
bro o(n) best one
int i,max,j; long int sum; sum=0; i=0; j=1; max=0; while(i if(calorie[max]
} if(j==calorie_count-1) { sum=sum+pow(2,i)*calorie[max]; i++; calorie[max]=-1; max=i; }
if(j==calorie_count-1) { j=0; } else { j++;
} } return sum; }
Seems like cookies are disabled on this browser, please enable them to open this website
Marc's Cakewalk
You are viewing a single comment's thread. Return to all comments →
bro o(n) best one
int i,max,j; long int sum; sum=0; i=0; j=1; max=0; while(i if(calorie[max]
if(j==calorie_count-1) { j=0; } else { j++;
} } return sum; }