4. Office Chairs (Lists Advanced)
Здравейте,
на задача 4 от Lists Advanced джъдж ми дава 80/100 и следното обяснение:
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
Опитах да събмитна наново, но без успех. Това е кодът ми:
n = int(input()) count_free_seats = 0 needed_chairs = 0 number_of_room = 1 for i in range(0, n): chairs, people = input().split() if len(chairs) > int(people): free_seats = len(chairs) - int(people) count_free_seats += free_seats elif len(chairs) < int(people): needed_chairs = abs(len(chairs) - int(people)) count_free_seats -= needed_chairs print(f"{needed_chairs} more chairs needed in room {number_of_room}") number_of_room += 1 if count_free_seats > 0: print(f"Game On, {count_free_seats} free chairs left")
Благодаря!
Ето и моето: