guess the next step: 0/1 knapsack
Before each step plays, guess what it does. The page then shows the step as the run takes it and says why, the same sentence the watch page says there.
Step 1 of 34
Question 1 of 32
Step 1 of 34
Step 2 of 34
Step 3 of 34
Step 4 of 34
Step 5 of 34
Step 6 of 34
Step 7 of 34
Question 1 of 32
Question 1 of 32
Not this time.
You guessed: Item A weighs more than the room of 1, so it cannot go in.
What the run did:
With room 1, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 1 of 32
Right.
You guessed: With room 1, taking item A is better, so take it.
What the run did:
With room 1, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 1 of 32
Not this time.
You guessed: With room 1, taking item A is no better, so leave it.
What the run did:
With room 1, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 2 of 32
Question 2 of 32
Not this time.
You guessed: Item A weighs more than the room of 2, so it cannot go in.
What the run did:
With room 2, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 2 of 32
Right.
You guessed: With room 2, taking item A is better, so take it.
What the run did:
With room 2, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 2 of 32
Not this time.
You guessed: With room 2, taking item A is no better, so leave it.
What the run did:
With room 2, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 3 of 32
Question 3 of 32
Not this time.
You guessed: Item A weighs more than the room of 3, so it cannot go in.
What the run did:
With room 3, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 3 of 32
Right.
You guessed: With room 3, taking item A is better, so take it.
What the run did:
With room 3, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 3 of 32
Not this time.
You guessed: With room 3, taking item A is no better, so leave it.
What the run did:
With room 3, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 4 of 32
Question 4 of 32
Not this time.
You guessed: Item A weighs more than the room of 4, so it cannot go in.
What the run did:
With room 4, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 4 of 32
Right.
You guessed: With room 4, taking item A is better, so take it.
What the run did:
With room 4, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 4 of 32
Not this time.
You guessed: With room 4, taking item A is no better, so leave it.
What the run did:
With room 4, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 5 of 32
Question 5 of 32
Not this time.
You guessed: Item A weighs more than the room of 5, so it cannot go in.
What the run did:
With room 5, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 5 of 32
Right.
You guessed: With room 5, taking item A is better, so take it.
What the run did:
With room 5, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 5 of 32
Not this time.
You guessed: With room 5, taking item A is no better, so leave it.
What the run did:
With room 5, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 6 of 32
Question 6 of 32
Not this time.
You guessed: Item A weighs more than the room of 6, so it cannot go in.
What the run did:
With room 6, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 6 of 32
Right.
You guessed: With room 6, taking item A is better, so take it.
What the run did:
With room 6, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.
Question 6 of 32
Not this time.
You guessed: With room 6, taking item A is no better, so leave it.
What the run did:
With room 6, leaving A out keeps 0. Taking it is worth 10, plus 0 for the room it leaves: 10. Taking it is better, so write 10.