Bomber Man wants to bomb an Array. 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5653 Description Given an array and some positions where to plant the bombs, You have to print the Total Maximum Impact. Each Bomb has some left destruction capability…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5653 题意:已知炸弹可以炸掉左边L个位置,右边R个位置,那么炸点炸掉的总数是L+R+1.给定每个炸弹的位置,求所有炸弹炸掉的格数总乘积 输出floor(1e6*log2(总乘积))那么到计算时就变成先取对数相加,最后乘以1e6下取整 思路:dp[r]=dp[l-1]*log2(r-l+1)当前区间的最大值等于上一个区间的最大值加上当前的值,解释见代码 #include<cstdio> #inclu…
题目链接: Bomber Man wants to bomb an Array. Time Limit: 4000/2000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 382    Accepted Submission(s): 114 Problem Description Given an array and some positions where to plant…
题意:bc 77 div1 1003(中文题面) 分析:先不考虑将结果乘以 1e6. 设 dp[i] 为从前 i 个格子的状态可以获得的最大破坏指数. 那么我们可以枚举每个炸弹,该炸弹向左延伸的距离和向又延伸的距离. 设第 i 个炸弹破坏区间为 [l, r], 则 dp[r] = dp[l - 1] + log2(r - l + 1).答案就是 dp[n - 1].不要忘记最后要向下取整. 注:我对官方题解稍作解释,dp[i]代表前i个格子可以获得的最大破坏指数 但是更新的时候,需要注意,假设有…
HDOJ(HDU).4508 湫湫系列故事――减肥记I (DP 完全背包) 题意分析 裸完全背包 代码总览 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #define nmax 100005 #define nn 105 using namespace std; int dp[nmax]; struct item{ int hap; int kal…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3555 Problem Description The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the curre…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3555 题目大意:从0开始到给定的数字N所有的数字中遇到“49”的数字的个数. Sample Input 3 1 50 500   Sample Output 0 1 15 Hint From 1 to 500, the numbers that include the sub-sequence "49" are "49","149","24…
Bomb Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 11804    Accepted Submission(s): 4212 Problem Description The counter-terrorists found a time bomb in the dust. But this time the terrorist…
Bomb Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 7926    Accepted Submission(s): 2780 Problem Description The counter-terrorists found a time bomb in the dust. But this time the terrorists…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3555 题意:上一题是不要62 这个是"不要49" 代码: #include <stdio.h> #include <ctime> #include <math.h> #include <limits.h> #include <complex> #include <string> #include <functio…