Demo entry 6343471

code_1

   

Submitted by lyt on Jan 09, 2017 at 13:15
Language: Python 3. Code size: 320 Bytes.

#coding:utf-8

def maxPayOff(A,B):
    A.sort()#顺序,逆序都可以,只要保持一致即可
    B.sort()
    n = len(A)
    sum = 1
    factor =1
    for i in xrange(0,n):
        factor = A[i]**B[i]
        sum = sum* factor
    return sum

if __name__ == '__main__':
    A = [3,4,5]
    B = [4,3,2]
    print(maxPayOff(A,B))

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).