码迷,mamicode.com
首页 >  
搜索关键字:poj 3348 cows    ( 21218个结果
POJ 3267
dp经典关于这道题,我看了网上大量的资料,发现整体思路是对的,但是细节解释是错的(或者说不到位)Len = strlen(say); say是牛说的话,下面的word代表单词列表dp[i]表示从say中第i个字符开始,到第Len-1个字符(结尾处)这段区间所删除的字符数,初始化为dp[i]=len-...
分类:其他好文   时间:2014-06-13 08:27:32    阅读次数:285
线段树题目汇总
POJ 3667 Hotel求某大于等于a的最长区间#include #include #include #include #define LEN 50001>1); lt[o>1; } tar[o]=-1; }...
分类:其他好文   时间:2014-06-12 19:56:27    阅读次数:319
poj-1151-Atlantis-线段树求面积并
很裸的线段树求面积并。 坐标需要离散化一下。 #include #include #include #include #include #include #include #include #pragma comment(linker, "/STACK:1024000000,1024000000") using namespace std; #define maxn 11000 #define...
分类:其他好文   时间:2014-06-10 19:23:46    阅读次数:200
POJ 3373 Changing Digits 好蛋疼的DP
一开始写的高位往低位递推,发现这样有些时候保证不了第四条要求。于是又开始写高位往低位的记忆化搜索,又发现传参什么的蛋疼的要死。然后又发现高位开始的记忆化搜索就是从低位往高位的递推呀,遂过之。 dp[i][j]记录在i位 且 余数为j时的最优解情况。 dp[i][j].next表示当前的最优解是由哪一种状态转移过来的。 代码又写锉了。。 #include #include #includ...
分类:其他好文   时间:2014-06-10 18:08:31    阅读次数:222
poj 2446 Chessboard (二分匹配)
ChessboardTime Limit:2000MSMemory Limit:65536KTotal Submissions:12800Accepted:4000DescriptionAlice and Bob often play games on chessboard. One day, Al...
分类:其他好文   时间:2014-06-10 16:31:11    阅读次数:261
POJ 1276 完全背包
---恢复内容开始---这道题就是明显的完全背包题啦,只不过物品的重量和价值是一样的。我就是按照《背包九讲》中完全背包的思路,先把物品的数量 ni 按照1,2,4,8...的规律分解,然后直接用简单背包暴力数据比较小,10种物品,每一种最多1000个,cash 2 #include 3 using ...
分类:其他好文   时间:2014-06-10 12:31:52    阅读次数:182
poj 2536 Gopher II (二分匹配)
Gopher IITime Limit:2000MSMemory Limit:65536KTotal Submissions:6345Accepted:2599DescriptionThe gopher family, having averted the canine threat, must f...
分类:其他好文   时间:2014-06-10 10:30:00    阅读次数:218
POJ - 1376 Robot
题意:求在可以一秒沿着既定方向走1到3步和向左或右转90度的情况下,从起点到终点的最短时间 思路:坑的是这机器人还有体积,所以不能走到边界,然后就是单纯的BFS #include #include #include #include #include using namespace std; const int MAXN = 110; struct node { int x,y;...
分类:其他好文   时间:2014-06-10 07:59:51    阅读次数:256
hdu3045之斜率DP
Picnic Cows Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1563    Accepted Submission(s): 478 Problem Description It’s summer voc...
分类:其他好文   时间:2014-06-10 07:00:32    阅读次数:262
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!