strategy.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:speccer 作者: bensimner 项目源码 文件源码
def __next__(self):
        if not self._pq:
            raise StopIteration

        pair = heapq.heappop(self._pq)
        t = pair.x

        for i in range(self._n):
            v = t[i] + 1
            tp = t[:i] + (v,) + t[i + 1:]

            if v > self.max_sizes[i]:
                if i not in self.continuation:
                    self.continuation[i] = tp
                continue

            if tp not in self._memo:
                pair = PairGen._Pair(*tp)
                heapq.heappush(self._pq, pair)
                self._memo[tp] = True

        return t
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号