上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 24 下一页
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2955 【题意】 有一个强盗要去几个银行偷盗,他既想多抢点钱,又想尽量不被抓到。已知各个银行 的金钱数和被抓的概率,以及强盗能容忍的最大被抓概率。求他最多能偷到多少钱? 【思路】 01背包:每个物品代价是每个银行钱 阅读全文
posted @ 2017-08-09 12:07 shulin15 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 【题目描述】 Description 神犇最近闲来无事,于是就思考哲学,研究数字之美。在神犇看来,如果一个数的各位能够被分成两个集合,而且这两个集合里的数的和相等,那么这个数就是优美的(具体原因就只有神犇才知道了)。现在神犇在思考另一个问题,在区间[a,b]中有多少个数是优美的?这个问题对于神犇来说 阅读全文
posted @ 2017-08-06 21:00 shulin15 阅读(374) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2844 【题意】 给定n种价值为Ci,个数为Wi的硬币,问在1~V中的这些数中哪些数能由这些硬币组成? 【思路】 多重背包,二进制优化,时间复杂度为O(V*log∑ni) 【Accepted】 1 #include 阅读全文
posted @ 2017-08-06 20:41 shulin15 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<cstdio> 3 #include<cmath> 4 #include<cstring> 5 #include<string> 6 #include<algorithm> 7 #include<queue> 8 #include<ve 阅读全文
posted @ 2017-08-06 19:05 shulin15 阅读(301) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3986 【题意】 给定一个有重边的无向图,T=20,n<=1000,m<=5000 删去一条边,使得1~n的最短路最长 求最短路最长是多少 【思路】 一定是删最短路上的边 可以先跑一个Dijkstra,求出最短路, 阅读全文
posted @ 2017-08-06 10:39 shulin15 阅读(180) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=6069 【题意】 给定l,r,k,求 d(n)是n的因子个数 【思路】 【Accepted】 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 阅读全文
posted @ 2017-08-04 22:52 shulin15 阅读(128) 评论(0) 推荐(0) 编辑
摘要: acm.hdu.edu.cn/showproblem.php?pid=6060 【题意】 给定一棵以1为根的树,把这颗树除1以外的结点划分为k个集合(可以有空集),把1加入划分后的集合 每个集合的结点形成一棵最小生成树 所有最小生成树的权值之和最大化 【思路】 最小生成树,每个点u到root 1都要 阅读全文
posted @ 2017-08-02 15:42 shulin15 阅读(215) 评论(0) 推荐(0) 编辑
摘要: acm.hdu.edu.cn/showproblem.php?pid=6058 【题意】 给定一个排列,计算 【思路】 计算排列A中每个数的贡献,即对于每个ai,计算有ni个区间满足ai是区间中的第k大,那么ai对答案的贡献就是ai*ni 以ai为起点,统计ai右边离ai最近的,比ai大的k个数的位 阅读全文
posted @ 2017-08-02 14:33 shulin15 阅读(270) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3047 【题意】 http://blog.csdn.net/hj1107402232/article/details/9921311 【Accepted】 1 #include<iostream> 2 #inclu 阅读全文
posted @ 2017-07-30 23:43 shulin15 阅读(129) 评论(0) 推荐(0) 编辑
摘要: https://www.bnuoj.com/v3/contest_show.php?cid=9154#problem/M 【Accepted】 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<string> 阅读全文
posted @ 2017-07-30 22:36 shulin15 阅读(138) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 24 下一页