会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
wolf940509
功到自然成。。。
博客园
首页
新随笔
联系
订阅
管理
1
2
3
4
5
···
20
下一页
2017年10月10日
Codeforces Round #439 (Div. 2)
摘要: A题 分析:注意异或以后可能会大于2e6,所以数组应该开到4e6。还有一种巧妙的解法就是用异或的性质,b^a^b=a,所以可以看出必然都是偶数对。 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "s
阅读全文
posted @ 2017-10-10 17:31 wolf940509
阅读(239)
评论(0)
推荐(1)
2017年9月30日
Money Systems
摘要: 链接 分析:来看看背包九讲里面的一段话: 对于一个给定了背包容量、物品费用、物品间相互关系(分组、依赖等) 的背包问题,除了再给定每个物品的价值后求可得到的最大价值外,还可以得 到装满背包或将背包装至某一指定容量的方案总数。对于这类改变问法的问题,一般只需将状态转移方程中的max改成sum即可。例如
阅读全文
posted @ 2017-09-30 00:02 wolf940509
阅读(169)
评论(0)
推荐(0)
2017年9月25日
Stamps
摘要: 链接 分析:dp[i][j]表示前i个数,组成j,最少需要多少个。dp[i][j]=min(dp[i-1][j],dp[i-1][j-k*v[i]]+k),则可以转化为完全背包问题,同样的方法进行降维处理即可。 1 #include "iostream" 2 #include "cstdio" 3
阅读全文
posted @ 2017-09-25 21:56 wolf940509
阅读(182)
评论(0)
推荐(0)
inflate
摘要: 链接 分析:裸的完全背包问题 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 using namespace std; 6 const int maxn=1e5+100; 7 i
阅读全文
posted @ 2017-09-25 10:58 wolf940509
阅读(181)
评论(0)
推荐(0)
2017年9月21日
多重背包问题
摘要: 51Nod1086 分析:二进制优化多重背包,推荐一篇不错的blog,点我 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 using namespace std; 6 cons
阅读全文
posted @ 2017-09-21 16:18 wolf940509
阅读(105)
评论(0)
推荐(0)
2017年9月14日
AIM Tech Round 4 (Div. 2)
摘要: A题 分析:暴力 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 using namespace std; 6 const int maxn=100+10; 7 int vis[
阅读全文
posted @ 2017-09-14 22:04 wolf940509
阅读(169)
评论(0)
推荐(0)
2017年9月8日
September Challenge 2017
摘要: Little Chef and Sums 分析:水题,去维护一下前缀和以及后缀和就好,注意long long 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 using name
阅读全文
posted @ 2017-09-08 10:19 wolf940509
阅读(175)
评论(0)
推荐(0)
2017年8月17日
树的重心
摘要: 树的重心:对于一棵n个结点的无根树,找到一个点,使得把树变成以该点为根的有根树树时,最大子树的结点数最小。关于重心的求法见《算法竞赛入门经典第二版》281页 下面来看两个基础的题目: 链接 分析:求出树的重心以及最大子树的结点数 1 #include "iostream" 2 #include "c
阅读全文
posted @ 2017-08-17 13:16 wolf940509
阅读(417)
评论(0)
推荐(0)
2017年8月12日
百度之星2017初赛A
摘要: 雪崩,没晋级,补题 1001 分析:求n-1的约数个数 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 #include "cmath" 6 using namespace st
阅读全文
posted @ 2017-08-12 23:09 wolf940509
阅读(382)
评论(0)
推荐(0)
2017年8月10日
树上的最大独立集
摘要: 最大独立集问题是指对于一棵n个结点的无根树,选出尽量多的结点,使得任何两个结点均不相邻,解答过程详见入门经典第二版280页,粘代码跑QAQ 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "strin
阅读全文
posted @ 2017-08-10 22:53 wolf940509
阅读(587)
评论(0)
推荐(0)
1
2
3
4
5
···
20
下一页
公告