2016年4月1日

[2016-04-01][poj][2533][Longest Ordered Subsequence]

摘要: 时间:2016-04-01 21:35:02 星期五 题目编号:[2016-04-01][poj][2533][Longest Ordered Subsequence] #include #include using namespace std;int dp[1000 + 10],a[1000 + 10];int main(){ int n; while(~sca... 阅读全文

posted @ 2016-04-01 21:58 红洋 阅读(114) 评论(0) 推荐(0)

[2016-03-28][POJ][3616][Milking Time]

摘要: 时间:2016-03-28 17:27:03 星期一 题目编号:[2016-03-28][POJ][3616][Milking Time] #include #include using namespace std;const int maxm = 1000 + 10;struct Roo{ int l,r,v; bool operator < (const Ro... 阅读全文

posted @ 2016-04-01 21:58 红洋 阅读(101) 评论(0) 推荐(0)

[2016-03-28][POJ][1458][Common Subsequence]

摘要: 时间:2016-03-28 12:56:39 星期一 题目编号:[2016-03-28][POJ][1458][Common Subsequence] 题目大意:最长公共序列 #include #include #include using namespace std;typedef long long LL;const int maxn = 1000 + 100;int dp[maxn][... 阅读全文

posted @ 2016-04-01 21:57 红洋 阅读(120) 评论(0) 推荐(0)

[2016-03-29][HDU][1176][免费馅饼]

摘要: 时间:2016-03-29 09:46:34 星期二 题目编号:[2016-03-29][HDU][1176][免费馅饼] #include #include #include using namespace std;const int maxt = 100000 + 10;int dp[maxt][11];int a[maxt][11];int main(){ int n,x... 阅读全文

posted @ 2016-04-01 21:56 红洋 阅读(120) 评论(0) 推荐(0)

[2016-03-28][HDU][1078][FatMouse and Cheese]

摘要: 时间:2016-03-28 17:40:34 星期一 题目编号:[2016-03-28][HDU][1078][FatMouse and Cheese] #include #include #include using namespace std;const int maxn = 100 + 10;int a[maxn][maxn];int dp[maxn][maxn];int n ,k;i... 阅读全文

posted @ 2016-04-01 21:55 红洋 阅读(138) 评论(0) 推荐(0)

[2016-03-28][POJ][3666][]Making the Grade]

摘要: 时间:2016-03-28 17:23:08 星期一 题目编号:[2016-03-28][POJ][3666][]Making the Grade] 分析:dp[i][j]表示把改到第i个数,且把a[i]改成b[i]需要的最少代价,已知b[j]递增,dp[i][j]由dp[i - 1][k]递推过来,如果改成非增,那么就要求 a[j] #include #include using namesp... 阅读全文

posted @ 2016-04-01 21:54 红洋 阅读(127) 评论(0) 推荐(0)

[2016-03-29][POJ][1661][]Help Jimmy]

摘要: 时间:2016-03-29 21:36:50 星期二 题目编号:[2016-03-29][POJ][1661][]Help Jimmy] #include #include #include using namespace std;int n,x,y,maxh;struct Plat{ int l,r,h; bool operator = l && _x = h ... 阅读全文

posted @ 2016-04-01 21:53 红洋 阅读(130) 评论(0) 推荐(0)

[2016-03-27][HDU][1260][Tickets]

摘要: 时间:2016-03-27 22:37:37 星期日 题目编号:[2016-03-27][HDU][1260][Tickets] 遇到的问题:分钟数字,除以60以后还要模60 t / 60 % 60 #include #include using namespace std;typedef long long LL;const int maxk = 2000 + 10;int s[maxk]... 阅读全文

posted @ 2016-04-01 21:52 红洋 阅读(114) 评论(0) 推荐(0)

[2016-03-27][HDU][1114][Piggy-Bank]

摘要: 时间:2016-03-27 16:37:56 星期日 题目编号:[2016-03-27][HDU][1114][Piggy-Bank] 遇到的问题:注意f == e的情况,即dp[0] = 0; #include #include #includeusing namespace std;int dp[10000 + 10];int w[500 + 10],c[500 + 10];int ma... 阅读全文

posted @ 2016-04-01 21:52 红洋 阅读(135) 评论(0) 推荐(0)

[2016-03-27][HDU][1087][Super Jumping! Jumping! Jumping!]

摘要: 时间:2016-03-27 15:51:40 星期日 题目编号:[2016-03-27][HDU][1087][Super Jumping! Jumping! Jumping!] 分析:dp[i]表示跳到第i个位置,能拿到的最多分,则dp[i] = max(dp[i] , dp[j] + v[i]) 能从j跳到i 遇到的问题:排序之和,a[1].v #include using namespac... 阅读全文

posted @ 2016-04-01 21:51 红洋 阅读(135) 评论(0) 推荐(0)

[2016-03-27][HDU][1257][最少拦截系统]

摘要: 时间:2016-03-27 14:51:35 星期日 题目编号:[2016-03-27][HDU][1257][最少拦截系统] 分析:贪心,每当不能拦截就增加一个拦截系统,可以发现,每个拦截系统拦截的高度比较和出现的顺序一样.即第二个系统始终比第一个系统拦截的高度高 #include using namespace std;int a[30000 + 10];int main(){ ... 阅读全文

posted @ 2016-04-01 21:50 红洋 阅读(177) 评论(0) 推荐(0)

[2016-03-29][POJ][3186][Treats for the Cows]

摘要: 时间:2016-03-29 15:26:04 星期二 题目编号:[2016-03-29][POJ][3186][Treats for the Cows] #include #include using namespace std;const int maxn = 2000 + 10;int dp[maxn][maxn];int a[maxn];int main(){ int n... 阅读全文

posted @ 2016-04-01 21:49 红洋 阅读(86) 评论(0) 推荐(0)

[2016-03-28][HDU][1074][Doing Homework]

摘要: 时间:2016-03-28 18:46:36 星期一 题目编号:[2016-03-28][HDU][1074][Doing Homework] 题目大意:给定n门科作业的期限时间和完成耗时,每科每超过一天就扣一份,求最少扣分数 分析:n只有15,二进制枚举,状态压缩,枚举每种科目完成的状态,更新下一个状态,求最小值 #include #include using namespace std;... 阅读全文

posted @ 2016-04-01 21:49 红洋 阅读(129) 评论(0) 推荐(0)

[2016-03-30][HDU][1069][Monkey and Banana]

摘要: 时间:2016-03-27 15:19:40 星期日 题目编号:[2016-03-30][HDU][1069][Monkey and Banana] 题目大意:给定n种积木无限个,问这些积木最大能叠多高,上面的积木长宽必须严格小于下面的积木 分析: dp[i]表示第i个积木在顶部时候的最大高度,那么dp[i] = max(dp[i],dp[j] + h[i]);∀ji能放在j上面∀ji能放在j... 阅读全文

posted @ 2016-04-01 21:48 红洋 阅读(164) 评论(0) 推荐(0)

[2016-03-27][HDU][1029][Ignatius and the Princess IV]

摘要: 时间:2016-03-30 22:03:01 星期三 题目编号:[2016-03-27][HDU][1029][Ignatius and the Princess IV] 题目大意:给定n个数字,输出其中出现次数超过n/2的数字 #include #include using namespace std;const int maxn = 1E6 + 10;int a[maxn];int ma... 阅读全文

posted @ 2016-04-01 21:47 红洋 阅读(135) 评论(0) 推荐(0)

[2016-03-28][HDU][1024][Max Sum Plus Plus]

摘要: 时间:2016-03-28 17:45:33 星期一 题目编号:[2016-03-28][HDU][1024][Max Sum Plus Plus] 题目大意:从n个数字提取出一定数字组成m个部分,使得这个部分的总和最大 分析: dp[i][j]表示前i段计算第j个数字,dp[i][j] = max(dp[i - 1][j - 1] + a[j],dp[i][k] + a[j]); #in... 阅读全文

posted @ 2016-04-01 21:46 红洋 阅读(146) 评论(0) 推荐(0)

[2016-03-29][HDU][2859][Phalanx]

摘要: 时间:2016-03-29 15:53:01 星期二 题目编号:[2016-03-29][HDU][2859][Phalanx] 分析:dp[i][j]表示以 (i,j)为左下角 #include #include using namespace std;const int maxn = 1000 + 10;char a[maxn][maxn];int dp[maxn][maxn],ans,... 阅读全文

posted @ 2016-04-01 21:45 红洋 阅读(158) 评论(0) 推荐(0)

[2016-04-01][codeforces][659E][New Reform]

摘要: 时间:2016-04-01 19:27:59 星期五 题目编号:[2016-04-01][codeforces][659E][New Reform] 题目大意:给定n个城市,m条路,每条路连接两个城市,每两个城市最多只有一条路连接,现在把路改成单项的,问最少会出现几个孤立的城市(没有城市到达它), 分析: 在一个联通分支中,如果边数为n - 1,那么这个图就是树,树上除了根节点,其他节点都可达... 阅读全文

posted @ 2016-04-01 20:37 红洋 阅读(251) 评论(0) 推荐(0)

[2016-04-01][codeforces][659D][Bicycle Race]

摘要: 时间:2016-04-01 19:10:24 星期五 题目编号:[2016-04-01][codeforces][659D][Bicycle Race] 题目大意:绕着海岸线行走,每次行走方式为上下左右,最后回到终点,在转弯的地方如果不及时转弯就会掉到水里,问有多少个地方可能掉到水里 分析: 可以发现,在内角为270°的地方才有可能掉到水里,设这样的地方有x个,则内角和 180 * (n - ... 阅读全文

posted @ 2016-04-01 19:21 红洋 阅读(152) 评论(0) 推荐(0)

[2016-03-31][codeforces][659C][Tanya and Toys]

摘要: 时间:2016-03-31 23:49:13 星期四 题目编号:[2016-03-31][codeforces][659C][Tanya and Toys].md 题目大意:有$10^9$种物品,第i种物品价值i,已经用用n个物品,给m元,问最多能买多少个还没拥有的物品 分析:贪心,从最低的开始买起,假设$m = 10^9$,那么也买的物品也不超过$10^6$个,因为$\frac{(1+k)k}... 阅读全文

posted @ 2016-04-01 00:22 红洋 阅读(147) 评论(0) 推荐(0)

导航