上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 76 下一页
摘要: 【bzoj2243】[SDOI2011]染色 2017年10月20日 Description 给定一棵有n个节点的无根树和m个操作,操作有2类: 1、将节点a到节点b路径上所有点都染成颜色c; 2、询问节点a到节点b路径上的颜色段数量(连续相同颜色被认为是同一段),如“112221”由3段组成:“1 阅读全文
posted @ 2017-10-20 15:59 Kaiser- 阅读(291) 评论(0) 推荐(1) 编辑
该文被密码保护。 阅读全文
posted @ 2017-10-20 07:39 Kaiser- 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 题意:给定一些点(xi,yi)(xj,yj)满足:i<j,xi<xj,yi>yj。用下面的连起来,使得所有边的长度最小? 题解:直接给出吧 f[i][j]=min(f[i][k]+f[k+1][j]+cost(i,j) cost(i,j)=a[k].y-a[j].y+a[k+1].x-a[i].x; 阅读全文
posted @ 2017-10-18 21:20 Kaiser- 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 题意:将n个数分成m段,每段的代价为最大值减最小值的平方,为代价最小是多少n<=10000 ,m<=5000 题解:先拍好序,从小到大,这样绝对是花费最小的,不过怎么样来做呢?一定很容易想到dp 分段dp十分好想吧,f[i][j]表示前i个数,分成j个数的最小值。 w[i][j]区间包含性十分好证明 阅读全文
posted @ 2017-10-18 21:18 Kaiser- 阅读(238) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-10-17 12:17 Kaiser- 阅读(2) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-10-17 06:55 Kaiser- 阅读(2) 评论(0) 推荐(0) 编辑
摘要: In a certain course, you take n tests. If you get ai out of bi questions correct on test i, your cumulative average is defined to be . Given your test 阅读全文
posted @ 2017-10-16 18:52 Kaiser- 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Farmer John has decided to reward his cows for their hard work by taking them on a tour of the big city! The cows must decide how best to spend their 阅读全文
posted @ 2017-10-16 18:49 Kaiser- 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 有N个小松鼠,它们的家用一个点x,y表示,两个点的距离定义为:点(x,y)和它周围的8个点即上下左右四个点和对角的四个点,距离为1。现在N个松鼠要走到一个松鼠家去,求走过的最短距离。 Input 第一行给出数字N,表示有多少只小松鼠。0<=N<=10^5下面N行,每行给出x,y表示其家的坐标。-10 阅读全文
posted @ 2017-10-16 18:47 Kaiser- 阅读(125) 评论(0) 推荐(0) 编辑
摘要: David the Great has just become the king of a desert country. To win the respect of his people, he decided to build channels all over his country to b 阅读全文
posted @ 2017-10-16 18:45 Kaiser- 阅读(180) 评论(0) 推荐(0) 编辑
上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 76 下一页