随笔分类 -  搜索

摘要:D题:https://codeforces.com/contest/1271/problem/D 题意:你初始有k只士兵,n个城堡,你要求要逐一攻破。 给出的信息a[i],b[i],c[i]代表第i个城堡被攻破需要a[i]个士兵(攻破不会造成士兵死亡),在第i个城堡你可以招募b[i]士兵,守护第i个 阅读全文
posted @ 2019-12-18 15:37 starve_to_death 阅读(246) 评论(0) 推荐(0)
摘要:题:https://codeforces.com/contest/1262/problem/E 分析:预处理出阵列中的矩阵,然后二分答案还原题目的烧火过程,判断是否满足要求 #include<bits/stdc++.h> using namespace std; #define pb push_ba 阅读全文
posted @ 2019-12-04 16:47 starve_to_death 阅读(293) 评论(0) 推荐(0)
摘要:学习:https://blog.csdn.net/qq_21334057/article/details/99550805 题意:从n个点中选择k个点构成多边形,问期望面积。 题解:如果能够确定两个点,那么可以从这两个点之间选择k−2个点来构成一个k边形。所以可以枚举两个点,计算这两个点被选入构成凸 阅读全文
posted @ 2019-10-03 16:07 starve_to_death 阅读(331) 评论(0) 推荐(0)
摘要:04 http://acm.hdu.edu.cn/showproblem.php?pid=6705 分析;先把每条边以 形式放进堆,堆按路径权值从小到大排序,然后每次取出堆顶,用v的出边扩展 新的路径。但是一个点的出度可能会非常大(如菊花图),可以发现,将出边排序之后, 每次只需要扩 展当前点最小的 阅读全文
posted @ 2019-08-24 00:03 starve_to_death 阅读(110) 评论(0) 推荐(0)
摘要:https://ac.nowcoder.com/acm/contest/889/D(超大背包) #include<bits/stdc++.h> using namespace std; //__ #define pb push_back typedef long long ll; typedef u 阅读全文
posted @ 2019-08-15 19:40 starve_to_death 阅读(160) 评论(0) 推荐(0)
摘要:文章:https://www.cnblogs.com/Mychael/p/8282895.html 康拓展开,知道数列求排名 康拓逆展开,知排名求数列 http://poj.org/problem?id=1077 #include<iostream> #include<cstring> #inclu 阅读全文
posted @ 2019-06-03 22:05 starve_to_death 阅读(173) 评论(0) 推荐(0)