<qiyuangong>276_Paint_Fence_2.py
def numWays( n, k):
    if n == 0:
        return 0
    elif n == 1:
        return k
    dp = [0] * 2
    dp[0] = k
    dp[1] = k * k
    for i in range(2, n):
        temp = dp[1]
        dp[1] = sum(dp) * (k - 1)
        dp[0] = temp
    return dp[1]
def sample_funcname ( var_0 , var_1 ) :
    if var_0 == 0 :
        return 0
    elif var_0 == 1 :
        return var_1
    var_5 = [ 0 ] * 2
    var_5 [ 0 ] = var_1
    var_5 [ 1 ] = var_1 * var_1
    for var_7 in range ( 2 , var_0 ) :
        var_8 = var_5 [ 1 ]
        var_5 [ 1 ] = sum ( var_5 ) * ( var_1 - 1 )
        var_5 [ 0 ] = var_8
    return var_5 [ 1 ]
