上一页 1 ··· 60 61 62 63 64 65 66 67 68 ··· 87 下一页
摘要: 题目大意: 农夫约翰为了修理栅栏 要将一块很长的木板切成 $N$ 块 准备切成的木板长度为 $L1, L2, L3......$ 未切割前木板长度刚好是切后木板长度和 每次切断木板的时候 需要的开销为这段木板的长度 样例: $N = 3, L = {8, 5, 8}$ 输出: 34 时间复杂度:$O 阅读全文
posted @ 2018-09-11 10:07 _Zlrrr 阅读(134) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3466 Problem Description Recently, iSea went to an ancient country. For such a long time, it was the most we 阅读全文
posted @ 2018-09-06 10:43 _Zlrrr 阅读(119) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2602 Problem Description Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector 阅读全文
posted @ 2018-09-06 10:40 _Zlrrr 阅读(101) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2546 Problem Description 电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则 阅读全文
posted @ 2018-09-06 10:38 _Zlrrr 阅读(90) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2680 Problem Description One day , Kiki wants to visit one of her friends. As she is liable to carsickness , 阅读全文
posted @ 2018-09-02 16:49 _Zlrrr 阅读(190) 评论(0) 推荐(0)
摘要: 题目大意: 有 $n$ 个物体 第 $i$ 个物体的体积为 $wi$ 价值为 $vi$ 背包容积为 $W$ 求所有挑选方案中价值总和的最大值 解法1: 针对每个物品是否放入背包进行搜索 时间复杂度:$O(2^n)$ 代码: 解法2: 记忆化搜索,把第一次计算结果存到 $dp$ 数组中,第二次之后如果 阅读全文
posted @ 2018-08-30 22:02 _Zlrrr 阅读(162) 评论(0) 推荐(0)
摘要: https://pintia.cn/problem-sets/994805046380707840/problems/994805070149828608 给定两个整数集合,它们的相似度定义为:/。其中N​c​​是两个集合都有的不相等整数的个数,N​t​​是两个集合一共有的不相等整数的个数。你的任务 阅读全文
posted @ 2018-08-30 13:11 _Zlrrr 阅读(214) 评论(0) 推荐(0)
摘要: https://pintia.cn/problem-sets/994805046380707840/problems/994805086365007872 大家应该都会玩“锤子剪刀布”的游戏:两人同时给出手势,胜负规则如图所示: 现要求你编写一个稳赢不输的程序,根据对方的出招,给出对应的赢招。但是! 阅读全文
posted @ 2018-08-30 13:06 _Zlrrr 阅读(305) 评论(0) 推荐(0)
摘要: https://pintia.cn/problem-sets/994805046380707840/problems/994805082313310208 给定两个矩阵A和B,要求你计算它们的乘积矩阵AB。需要注意的是,只有规模匹配的矩阵才可以相乘。即若A有R​a​​行、C​a​​列,B有R​b​​ 阅读全文
posted @ 2018-08-29 20:54 _Zlrrr 阅读(306) 评论(0) 推荐(0)
摘要: 贪心练习 题目大意: 直线上有 $N$ 个点, 点 $i$ 的位置是 $Xi$ 。从这些点中选取若干个,给他们加上标记,对每一个点,其距离为 $R$ 以内的区域里必须有一个带标记的点,在这个条件下希望尽可能少的添加标记,球被加上标记的点的个数 题解: 从最左开始考虑,距离为 $R$ 以内最远的点,因 阅读全文
posted @ 2018-08-29 12:36 _Zlrrr 阅读(185) 评论(0) 推荐(0)
上一页 1 ··· 60 61 62 63 64 65 66 67 68 ··· 87 下一页