finish level5/disorderly-escape #8
@ -1,9 +1,22 @@
|
|||||||
|
import math
|
||||||
|
|
||||||
def solution(w, h, s):
|
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 = [
|
tests = [
|
||||||
([2, 3, 4], '430'),
|
([2, 3, 4], '430'),
|
||||||
([2, 2, 2], '7'),
|
([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:
|
for i, o in tests:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user