摘要: 洛谷P873 砍树 原题链接 #include "iostream" #include "algorithm" using namespace std; int n,maxx,tree[1000001]={0}; bool check(int x) { long long sum=0; for(in 阅读全文
posted @ 2023-01-14 18:34 Cheng_Mao 阅读(34) 评论(0) 推荐(0)
摘要: next_permutation 位于algorithm算法库中 支持传入需要遍历的范围 且对原数据会进行修改 若无下次可能的排列 则返回false,所以常与while搭配使用 该函数也支持字符遍历,因为底层通过字典序进行遍历 此外使用该函数前必须从字典序排好序 否则只会遍历未排序之后的情况 #in 阅读全文
posted @ 2023-01-14 15:02 Cheng_Mao 阅读(15) 评论(0) 推荐(0)