Sharpen Your Brain :)

There’re 6 items on the table. Each item has difference value and weight. You have a 100-kg-capacity-bag. So which items do you prefer to take?

List of item
a) : 100kg… 40$…Lots of Dick
b) : 50kg… 35$…Diamond Sword
c) : 45kg… 18$…Golden Jar
d) : 20kg… 4$…Jade Cup
e) : 10kg… 10$…Computer Notebook
f) : 5kg… 2$…Freeman’s Head :freeman:

Show your solution and algorithm.

Volume is more important than weight when it comes to bags dammit.

I choose the diamond sword because they are awesome.

I choose A.
Lots and lots of A.
OP please tell me you can grant my wish.

What’s the goal? To get the most value per weight? Well obviously just 10 of E. No work done - no algorithm.

no no no
There is just a piece of each item. You can bring any item that is in the condition : total weight < 100 kg.
Value per weight is not the optimal way isn’t it?

this goes beyond my comprehension

I think i’ll stick with brain age 2 and my structures homework.

The tread fail

So you right. That’s not algorithm, just the solution

for(i=0;i<6;i++)
{
Value_Density[i][0]=Value[i]/Weight[i];
Value_Density[i][1]=Value[i];
Value_Density[i][2]=Weight[i];
}
Sort_maxtomin(Value_Density[][0]);

for(i=0;WEIGHT!>100;i++)
{
VALUE=VALUE+Value_Density[i][1];
WEIGHT=WEIGHT+Value_Density[i][2];
}

return VALUE;

This is algorithm isn’t it? greedy one, if im not wrong.

the dicks. i dont know why

a sausage and sandpaper.

I think you do.

this

insatiable hunger for the cock

Boingo boingo whoopsie knickers :jizz:

No one can fight properly with a 50 kilo sword.
I choose you, dick!

Oh, it’s the Knapsack Problem. You smart bastard.

How 'bout this :
There are the villages,A and B, stand beside each other.
Their entrance road combine at the Jeannotvb’s hut.
Everyday, Jeannotvb sit on the wood at the crossroad, answering the outlander about the road.
But, there’s condition that the outlander should know:
Someday He tells the truth, someday he tells a lie. We are never know.
What question would you ask him that make you know where is the ‘A’ village?
ONLY one question.

Ignore my grammatical errors.

“Where’s the “A” village and if you lie to me I’ll fucking kill you, understood?”

I think that might reduce the chances he lies…

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valve’s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.