傳送門題面:Graph TheoryTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1220 Accepted Submission(s): 553Problem DescriptionLittle Q loves playing with different kinds of graphs very muc…
Python 楊輝三角形的簡單實現
介紹: 楊輝三角
實現:
# -*- coding: utf-8 -*-def triangles():L[1]while True:yield LL [1] [ L[i-1] L[i] for i in range(1,len(L)) ] [1]n 0
for t in triangles():print(t)n n1if n 10 :break
效果&#x…