finish level5/disorderly-escape #8

Merged
seongbeom_park merged 6 commits from level5/disorderly-escape into main 2022-03-21 07:37:12 +00:00
Showing only changes of commit c4efc8d7d1 - Show all commits

View File

@ -1,9 +1,22 @@
import math
def solution(w, h, s):
return '0'
return str(sum([s**cycle for cycle in generate_cycles(w, h)])/(math.factorial(w)*math.factorial(h)))
def generate_cycles(w, h):
yield 1
tests = [
([2, 3, 4], '430'),
([2, 2, 2], '7'),
([1, 1, 2], '2'),
([1, 1, 3], '3'),
([2, 1, 2], '3'),
([1, 2, 2], '3'),
([3, 1, 2], '4'),
([1, 3, 2], '4'),
([2, 3, 2], '13'),
]
for i, o in tests: