上一页 1 ··· 5 6 7 8 9 10 11 12 下一页
摘要: Description: Hint: $n \le 10^5$ Solution: 掌握了线段树区间合并的套路,这题就很简单了,树剖之后用线段树维护左右颜色,和区间颜色段数,查询跳链时分类讨论一下中间的颜色是否相同,修改直接修改就行了,代码稍有细节 cpp include define ls p 1 阅读全文
posted @ 2019-02-27 19:22 cloud_9 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Description: 有 n 名同学要乘坐摆渡车从人大附中前往人民大学,第 i位同学在第 t 分钟去 等车。只有一辆摆渡车在工作,但摆渡车容量可以视为无限大。摆渡车从人大附中出发、 把车上的同学送到人民大学、再回到人大附中(去接其他同学),这样往返一趟总共花费m分钟(同学上下车时间忽略不计)。摆 阅读全文
posted @ 2019-02-26 20:15 cloud_9 阅读(407) 评论(0) 推荐(0) 编辑
摘要: Description: 给定两个有n个数的序列,你可以将其中一个进行旋转(想象是在一个环上),或者对序列的a56爆大奖在线娱乐数加上一个非负整数C 求操作后 $\sum{(a_i b_i)^2}$的最小值 Description: $n using namespace std; const int mxn=1e6 阅读全文
posted @ 2019-02-26 12:29 cloud_9 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Description: FFT真的容易忘,a56爆大奖在线娱乐就放到上面来了 cpp include using namespace std; const int mxn=4e6+5; const double PI=acos( 1); int n,m,l,lim=1,r[mxn]; struct cp { do 阅读全文
posted @ 2019-02-25 21:10 cloud_9 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Description: 用a56爆大奖在线娱乐数据结构,模拟单旋splay的以下操作: 1.插入一个数 2.查询最小值,单旋到根 3.查询最大值,单旋到根 4.查询最小值,单旋到根删除 5.查询最大值,单旋到根删除 Hint: $n,m define ls p::iterator sit; const int m 阅读全文
posted @ 2019-02-25 18:31 cloud_9 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Description: 在方格图上找一条回路使经过的权值最小 Hint: $n using namespace std; typedef long long ll; const int mxn=102,c[4]={0, 1,1,0}; struct data { int key; ll val; 阅读全文
posted @ 2019-02-24 15:59 cloud_9 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Description: 给定一棵n个点的树,点带点权。 有m次操作,每次操作给定x,y,a56爆大奖在线娱乐修改点x的权值为y。 你需要在每次操作之后求出这棵树的最大权独立集的权值大小。 Hint: $n,m define ls psz[son[u]]) son[u]=v; } } void dfs2(int u 阅读全文
posted @ 2019-02-24 13:52 cloud_9 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Description: 给定一棵n个点的带权树,结点下标从1开始到N。寻找树中找两个结点,求最长的异或路径。 Hint: $n using namespace std; const int mxn=1e7+5; struct ed { int to,nxt,w; }t[mxn=0; i) { in 阅读全文
posted @ 2019-02-24 13:45 cloud_9 阅读(192) 评论(0) 推荐(0) 编辑
摘要: Description: 给出n m的方格,有些格子不能铺线,其它格子必须铺,可以形成多个闭合回路。问有多少种铺法? Hint: $n,m using namespace std; typedef long long ll; const int mxn=15,c[4]={0, 1,1,0}; str 阅读全文
posted @ 2019-02-23 19:02 cloud_9 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Description: 一个 m n 的棋盘,有的格子存在障碍,求经过所有非障碍格子的哈密顿回路个数 Hint: $n,m using namespace std; typedef long long ll; const int mxn=15,c[4]={0, 1,1,0}; struct dat 阅读全文
posted @ 2019-02-23 14:43 cloud_9 阅读(112) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 下一页