会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
fenicnn
Whatever doesn't kill you, makes you stronger
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
21
22
23
24
25
26
27
28
29
···
40
下一页
2016年6月27日
Educational Codeforces Round 11 C. Hard Process 前缀和+二分
摘要: 题目链接: http://codeforces.com/contest/660/problem/C 题意: 将最多k个0变成1,使得连续的1的个数最大 题解: 二分连续的1的个数x。用前缀和判断区间[i,i+x-1]里面0的个数是否小于等于k。 代码:
阅读全文
posted @ 2016-06-27 10:59 fenicnn
阅读(191)
评论(0)
推荐(0)
2016年6月25日
BZOJ 3436: 小K的农场 差分约束
摘要: 题目链接: http://www.lydsy.com/JudgeOnline/problem.php?id=3436 题解: 裸的差分约束: 1、a>=b+c -> b<=a-c -> d[v]<=d[u]+w -> 建一条边从a到b,权值为-c 2、a<=b+c -> d[v]<=d[u]+w -
阅读全文
posted @ 2016-06-25 22:09 fenicnn
阅读(130)
评论(0)
推荐(0)
codeforces GYM 100114 J. Computer Network 无相图缩点+树的直径
摘要: 题目链接: http://codeforces.com/gym/100114 Description The computer network of “Plunder & Flee Inc.” consists of n servers and m two-way communication lin
阅读全文
posted @ 2016-06-25 21:19 fenicnn
阅读(370)
评论(0)
推荐(0)
2016年6月24日
Codeforces Bubble Cup 8 - Finals [Online Mirror] B. Bribes lca
摘要: 题目链接: http://codeforces.com/contest/575/problem/B 题解: 把链u,v拆成u,lca(u,v)和v,lca(u,v)(v,lca(u,v)是倒过来的)。这样就只要考虑自下而上的线性结构了,可以用前缀和的思想来做成段更新。 代码:
阅读全文
posted @ 2016-06-24 00:30 fenicnn
阅读(242)
评论(0)
推荐(0)
2016年6月23日
BZOJ 2763: [JLOI2011]飞行路线 spfa dp
摘要: 题目链接: http://www.lydsy.com/JudgeOnline/problem.php?id=2763 题解: d[x][kk]表示从s到x用了kk次免费机会的最少花费。 代码:
阅读全文
posted @ 2016-06-23 00:51 fenicnn
阅读(129)
评论(0)
推荐(0)
2016年6月20日
HDU 5486 Difference of Clustering 图论
摘要: 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5486 题意: 给你每个元素一开始所属的集合和最后所属的集合,问有多少次集合的分离操作,并操作和不变操作。 分离:[m1,m2,m3]->[m1],[m2],[m3] 合并:分离的逆操作 不变:[m1,
阅读全文
posted @ 2016-06-20 23:17 fenicnn
阅读(194)
评论(0)
推荐(0)
2016年6月19日
BZOJ 1143: [CTSC2008]祭祀river 最大独立集
摘要: 题目链接: http://www.lydsy.com/JudgeOnline/problem.php?id=1143 题解: 给你一个DAG,求最大的顶点集,使得任意两个顶点之间不可达。 把每个顶点v拆成v和v',对于边u,v,建成(u,v'),得到一个二分图。 先对二分图floyd求闭包,然后求二
阅读全文
posted @ 2016-06-19 00:16 fenicnn
阅读(210)
评论(0)
推荐(0)
2016年6月9日
Codeforces Round #328 (Div. 2) D. Super M
摘要: 题目链接: http://codeforces.com/contest/592/problem/D 题意: 给你一颗树,树上有一些必须访问的节点,你可以任选一个起点,依次访问所有的必须访问的节点,使总路程最短。 题解: 由于是树,任意两点间路径唯一,是确定的。 首先我们要先建一颗树:包括所有必须访问
阅读全文
posted @ 2016-06-09 16:18 fenicnn
阅读(209)
评论(0)
推荐(0)
hihocoder #1300 : 展胜地的鲤鱼旗 dp
摘要: 题目链接: http://hihocoder.com/problemset/problem/1300 题解: 先用栈预处理出每个‘)’匹配的‘(’的位子,放在pos数组中。 dp[i]表示以i结尾的合法子串个数,则易知转移方程: dp[i]=dp[pos[i]-1]+1; 代码:
阅读全文
posted @ 2016-06-09 10:38 fenicnn
阅读(123)
评论(0)
推荐(0)
hihocoder #1301 : 筑地市场 数位dp+二分
摘要: 题目链接: http://hihocoder.com/problemset/problem/1301?sid=804672 题解: 二分答案,每次判断用数位dp做。
阅读全文
posted @ 2016-06-09 01:30 fenicnn
阅读(181)
评论(0)
推荐(0)
上一页
1
···
21
22
23
24
25
26
27
28
29
···
40
下一页
公告