上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 22 下一页
摘要: "P2761 软件补丁问题" 二进制储存状态+spfa cpp include include include include using namespace std; int b1[102],b2[102],f1[101],f2[102]; int cost[102]; char in[102]; 阅读全文
posted @ 2018-04-16 20:23 Lance1ot 阅读(117) 评论(0) 推荐(0) 编辑
摘要: https://www.bilibili.com/video/av21425968?from=search&seid=7606938102305697217 阅读全文
posted @ 2018-04-16 20:14 Lance1ot 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 使用了匈牙利算法(就是暴力) 具体思路还是友链吧 "这是大佬" "这是我基佬" ~~然而他是一位htlm选手。所以看他的blog会很卡~~ 我就是想解释一下vis数组的意义~~可能有纰漏o( ̄▽ ̄)d ~~ cpp include include include include include us 阅读全文
posted @ 2018-04-15 08:28 Lance1ot 阅读(123) 评论(0) 推荐(0) 编辑
摘要: "我的思路" 代码: cpp include include include include include using namespace std; vectordeath[100010]; vectorhunt[100010]; vectortree[100010]; int ans[10001 阅读全文
posted @ 2018-04-14 19:49 Lance1ot 阅读(164) 评论(0) 推荐(0) 编辑
摘要: "P3958 奶酪" 暴力搜索,然而我noip bfs写炸了~~怪我太蒟蒻了~~ 先预处理出所有的路径(虽然这道题搜索的时候直接暴力判就可以,而且还比预处理跑的快) 再dfs,对于一个点。如果已经访问了他,那么再访问就没有意义了。我们可以这样简单的做一个记忆 阅读全文
posted @ 2018-04-11 21:08 Lance1ot 阅读(121) 评论(0) 推荐(0) 编辑
摘要: "P2312 解方程" 感谢pks的卡常 对于一个高于3次的一元方程,是没有求根公式的 但对于信奥的来说,可以枚举解来进行检验~~数学奥赛~~ 性能的瓶颈就成了检验 我们可以利用 "秦九韶" 来进行加快检验 cpp include include using namespace std; long 阅读全文
posted @ 2018-04-11 19:10 Lance1ot 阅读(173) 评论(0) 推荐(0) 编辑
摘要: "P1069 细胞分裂" 考虑质因数分解 先将m1,质因数分解后再根据数学定理将所有质数的质数全乘m2 然后将输入的数据相同处理,再判断 顺便说一下判断规矩 1肯定不行 如果分解后有没有m1质因数分解中的因数,对答案不影响 但是如果没有m1中的质因数,那么这个数肯定不行 如果都有的话 就将问题转化为 阅读全文
posted @ 2018-04-10 20:54 Lance1ot 阅读(219) 评论(0) 推荐(0) 编辑
摘要: "P1168 中位数" 一个大根堆,一个小根堆。胡乱搞搞就可以了,根据中位数的计算方法。 cpp include include include struct Min_heap { int tail; int data[100010]; int top() { return data[1]; } v 阅读全文
posted @ 2018-04-09 18:57 Lance1ot 阅读(180) 评论(0) 推荐(0) 编辑
摘要: "P1631 序列合并" 首先,对于最暴力的算法。就是将n^2个和全都枚举出来。然后排序 可是,在数据范围很大的时候,空间和时间都不能通过 所以我们就要优化~~ 废话~~ 首先我们的贪心策略不会变。优化的只能是枚举和的步骤 我们来看,对于A中的第i项和B中的第j项(A、B都是升序) 只有第i项和第j 阅读全文
posted @ 2018-04-09 18:25 Lance1ot 阅读(112) 评论(0) 推荐(0) 编辑
摘要: "P3385 【模板】负环" bfs—spfa太慢,对于判负环 就只能用dfs—spfa 判负环的依据,具体会体现在code中 还有一道题也是判环 思路也是类似 "我的思路" cpp include include include include using namespace std; struc 阅读全文
posted @ 2018-04-03 15:29 Lance1ot 阅读(162) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 22 下一页