上一页 1 ··· 8 9 10 11 12
摘要: hdu5418 Victor and World 传送门 题意 有一个n个顶点,m条边的图,每条边都有正权值,从1号点出发,经过每个顶点至少一次,最后回到1号点,求总权值的最小值。 1<=n<=16,1<=m<=100000。 题解 每个顶点可以重复经过,首先利用floyed计算出两个顶点之间的最短 阅读全文
posted @ 2020-06-15 15:13 fxq1304 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 单点修改,区间求和 #define lowbit(x) x&(-x) const int maxn=100010; int n,bit[2*maxn]; int query(int x){ int s=0; while(x>0){ s+=bit[x]; x-=lowbit(x); } return 阅读全文
posted @ 2020-06-09 15:02 fxq1304 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 模板一:区间增值,区间求和 模板题:hud1556 Color the ball const int maxn=100010; int a[maxn],tree[4*maxn],lazy[4*maxn]; void pushup(int o){ tree[o]=tree[o<<1]+tree[o<< 阅读全文
posted @ 2020-06-09 00:06 fxq1304 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 模板一:单点修改,区间求和 模板题:hdu1166 敌兵布阵 const int maxn=100010; int a[maxn],tree[4*maxn]; void pushup(int o){ tree[o]=tree[o<<1]+tree[o<<1|1]; } void build(int 阅读全文
posted @ 2020-06-05 22:24 fxq1304 阅读(168) 评论(0) 推荐(0) 编辑
摘要: hdu1176 免费馅饼 传送门 题意 有一个长度为11(标号从0到10)的数轴,n个馅饼分别在时间t掉落在点x上。有一个人在时刻0位于x=5处,每一秒可以移动到左右两端的位置并且接住那一秒掉落在相应位置的馅饼,他也可以选择不移动接住掉落在当前位置的馅饼。求出他能接到的馅饼数量的最大值。 \(0<n 阅读全文
posted @ 2020-06-05 18:00 fxq1304 阅读(97) 评论(0) 推荐(0) 编辑
摘要: hdu4825 Xor Sum 传送门 题意 给定一个集合,包含n个正整数,发起m次询问,每次询问包含一个正整数s,每次在集合中找到一个正整数k,使得s与k的异或值最大,输出正整数k。 1<=n,m<=100000,正整数不超过$2^{32}$。 题解 暴力寻找必然超时,需要优化查找方法。 假设询问 阅读全文
posted @ 2020-05-30 21:10 fxq1304 阅读(89) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12