美文网首页
python解无忧公主的数学时间097.py

python解无忧公主的数学时间097.py

作者: 火星猎手 | 来源:发表于2016-03-30 00:39 被阅读68次

python解无忧公主的数学时间097.py

097.gif
"""
python解无忧公主的数学时间097.py
codegay 2016年3月30日 00:17:26
http://mp.weixin.qq.com/s?__biz=MzI5ODEwMDQyNw==&mid=402225879&idx=1&sn=6ea8e1d5e6a2520ad65eb2713a98af6e&3rd=MzA3MDU4NTYzMw==&scene=6#rd
"""
from itertools import product
n=[[h for h in range(1,7+1)] for r in range(5)]
f=lambda x:x[1]>x[0] and x[1]>x[2] and x[3]>x[2] and x[3]>x[4] and len(set(x))==5
x={r for r in product(*n) if f(r)}
print("097结果:",len(x))
#336
#[Finished in 0.1s]

相关文章

网友评论

      本文标题:python解无忧公主的数学时间097.py

      本文链接:https://www.haomeiwen.com/subject/ejprlttx.html