标签:== tail article 除法 sdn tps enc python2 detail
思路:参考https://blog.csdn.net/qq_41822235/article/details/82109081 里面的方法4
同时因为python2.7的原因,除法会省去小数点后面的数字,if语句那里加了一句ij == 2tsum,
# -*- coding:utf-8 -*-
class Solution:
def FindContinuousSequence(self, tsum):
# write code here
res = []
for i in range((tsum)//2+1, 1, -1):
j = 2*tsum / i
if i*j == 2*tsum and (j-i+1)>0 and (j-i+1) % 2 == 0:
res.append([ii+(j-i+1)/2 for ii in range(i)])
return res
标签:== tail article 除法 sdn tps enc python2 detail
原文地址:https://www.cnblogs.com/dolisun/p/11332087.html