摘要: 子段与子段和的概念: 给定一个由数字组成的序列,其中一段连续的序列称为一个子段(假设非空),子段中所有的数字和就是为 子段和 例子: {1,2,3,4} , 连续子段有 {1} {1,2} {1,2,3} {1,2,3,4} {2,3} {2,3,4} {3,4} {4} O(n2) 枚举的做法: 阅读全文
posted @ 2019-03-19 22:42 zz2108828 阅读(2231) 评论(0) 推荐(0) 编辑
摘要: 有时候要用到全排列 next_permutation 进行枚举 <algorithm> std::next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp) std::next_per 阅读全文
posted @ 2019-03-19 21:53 zz2108828 阅读(440) 评论(0) 推荐(0) 编辑