第三个月开始生兔子是 f(n) = f(n-1) +f(n-2)
低四个月开始生兔子是f(n) = f(n-1) + f(n-3)
低四个月开始生兔子是f(n) = f(n-1) + f(n-3)
2021-06-30
def search(datas):
if not datas:
print(arranges)
global total
total += 1
else:
for data in datas:
arranges.append(data)
next_datas = datas[:]
next_datas.remove(data)
search(next_datas)
arranges.pop()
if not datas:
print(arranges)
global total
total += 1
else:
for data in datas:
arranges.append(data)
next_datas = datas[:]
next_datas.remove(data)
search(next_datas)
arranges.pop()
2020-12-10
# 判断/方向
for i in range(x):
if y + 1 + i <= 7:
if board[x - 1 - i][y + 1 + i] == 1: # 不判断当前点
return False
# 判断\方向
for i in range(x):
if y - 1 - i >= 0:
if board[x - 1 - i][y - 1 - i] == 1: # 不判断当前点
return False
for i in range(x):
if y + 1 + i <= 7:
if board[x - 1 - i][y + 1 + i] == 1: # 不判断当前点
return False
# 判断\方向
for i in range(x):
if y - 1 - i >= 0:
if board[x - 1 - i][y - 1 - i] == 1: # 不判断当前点
return False
2020-10-16