Basic Syntax, Conditional Statements and Loops - Exercise
Здравейте. Имам въпрос относно задача номер 10. Cristmas Spirit.
Решавам задачите повторно за да опресня знанията си, но се натъкнах в judge на 50/100 въпреки, че на тестовите решения отговора ми пасва. Ако може да погледнете и да ми кажете къде бъркам. Благодаря предварително!
Eто как съм го написал аз:
quantity = int(input())
days = int(input())
christmas_spirit = 0
ornament_set = 0
tree_skirt = 0
tree_garlands = 0
tree_lights = 0
for day in range(1, days + 1):
if day % 2 == 0:
ornament_set += quantity
christmas_spirit += 5
if day % 3 == 0:
tree_skirt += quantity
tree_garlands += quantity
christmas_spirit += 13
if day % 5 == 0:
tree_lights += quantity
christmas_spirit += 17
if day % 10 == 0:
christmas_spirit -= 20
tree_skirt += 1
tree_garlands += 1
tree_lights += 1
if day == 11:
quantity = quantity + 2
if days == 10:
christmas_spirit -= 30
ornament_price = ornament_set * 2
tree_skirt_price = tree_skirt * 5
tree_garlands_price = tree_garlands * 3
tree_lights_price = tree_lights * 15
total_cost = ornament_price + tree_garlands_price + tree_lights_price + tree_skirt_price
print(f"Total cost: {total_cost}")
print(f"Total spirit: {christmas_spirit}")