Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Bag of Santa Claus by Moff
import math
max_gift = 0
def choose_good_gift(current_gift, gifts_in_bag, gift_number):
global max_gift
if gift_number == 1:
max_gift = 0
max_gift = max(current_gift, max_gift)
if gift_number * math.e < gifts_in_bag:
return False
if current_gift >= max_gift:
return True
Aug. 11, 2015