
DP
文章平均质量分 79
fyfcauc
这个作者很懒,什么都没留下…
展开
-
poj-1837
// 1644K 16MS G++#include #include #include using namespace std;#define MAX_W 25#define MAX_W_NUM 20#define MAX_L 15#define MAX MAX_W*MAX_L*MAX_W_NUM#define MAXLENGTH MAX*2 + 1#def原创 2014-07-24 10:26:46 · 524 阅读 · 0 评论 -
poj-3280
// 16520K 141MS G++#include #include #include using namespace std;struct OP { char valid; int addCost; int removeCost;};const int MAX = 2010;long DP[MAX][MAX];原创 2014-08-31 21:58:12 · 515 阅读 · 0 评论 -
poj-2948
//5476K 657MS G++#include #include using namespace std;const int MAX = 510;int DP[MAX][MAX];int ymap[MAX][MAX];int bmap[MAX][MAX];int H;int W;int ySum[MAX][MAX];int bSum[MAX][MAX];原创 2014-09-01 13:29:57 · 539 阅读 · 0 评论 -
poj-2029
// 444K 0MS G++#include #include using namespace std;const int MAX = 110;char map[MAX][MAX];int maxLength;int maxHeight;int estateLength;int estateHeight;int treeNum;int DP[MAX][MAX]原创 2014-09-01 11:05:10 · 402 阅读 · 0 评论 -
poj-1925
//4380K 469MS G++#include #include #include using namespace std;const int MAX = 1000005;int buildingNum;struct Building { long long x; //notice! should use long long long long y;原创 2014-09-01 16:32:11 · 443 阅读 · 0 评论 -
poj-1037
#include #include using namespace std;int fences[25];bool DFSFlag[25];int caseNum;int plankNum;int ordinal;int visitedAvaCombination;// void printFence(int * fences) {// // printf("原创 2014-09-24 09:55:45 · 504 阅读 · 0 评论 -
poj-3254
//632K 16MS C++#include #include using namespace std;const int MAX = 13;const int M = 100000000;int map[MAX][MAX];long long solutionNum;int W;int H;#define S (1<<13)int degree[13原创 2014-09-02 14:15:28 · 564 阅读 · 0 评论 -
poj-1054
//25008K 1891MS G++#include #include #include #include using namespace std;int W;int H;const int MAX = 5010;struct Flatten { int x; int y;};typedef struct Flatten Flatten;Flatten fl原创 2014-09-01 22:24:55 · 740 阅读 · 0 评论 -
poj-1185
//#include #include using namespace std;long long maxNum;int W;int H;#define NN (101)#define S (1<<9 + 1)int degree[13] = {0, 1, 2, 4 ,8, 16, 32, 64, 128,原创 2014-09-02 20:28:50 · 497 阅读 · 0 评论 -
poj-2057
// 252K 32MS C++#include #include #include #include #include #include using namespace std;const int MAX = 2005;// dp[i][0]表示以该点为根的节点找不到房子时要爬行最少的距离, 这个值有什么用呢?// 这个值就是用去计算房子落在其他叶子节点原创 2014-09-03 17:33:03 · 572 阅读 · 0 评论 -
poj-1191
//592K 32MS C++#include #include #include using namespace std;long DP[16][9][9][9][9];int chess[8][8];long getSquareSum(int x1, int y1, int x2, int y2) { if (x1 > x2 || y1 < y2) { return原创 2014-08-31 14:27:24 · 435 阅读 · 0 评论 -
poj-3071
//528K 94MS G++ #include #include #include const int MAX = 130;double P[MAX][MAX];double DP[MAX][9];int N;int teamNum;void getVSId(int curTeamId, int winTime, int & beginVSId, int &原创 2014-09-05 11:02:55 · 394 阅读 · 0 评论 -
poj-3267
#include #include #include #include using namespace std;int DP[305][305]; //int DP2[305];string dict[605];int W; // num of dictint L; // length of messagestring message;#define INF 99原创 2014-07-24 19:34:30 · 400 阅读 · 0 评论 -
poj-1836
//380K 79MS G++#include #include using namespace std;double soldiers[1005];struct soldierInfo{ double prevHeight; int num;};typedef struct soldierInfo soldierInfo;soldierInfo a原创 2014-07-25 17:16:43 · 486 阅读 · 0 评论 -
poj-1159
// 49424K 750MS G++#include #include using namespace std;#define MAX 5005short DP[MAX][MAX];// int DP[MAX];char str[MAX];int length;void solve() { memset(DP, 0xff, sizeof(DP)); for (in原创 2014-07-27 18:49:25 · 473 阅读 · 0 评论 -
poj-3176
// 1356K 32MS G++#include #include #define MAX 360long DP[MAX][MAX];long DP2[MAX];int cows[MAX][MAX];int rowNum;void solve() { memset(DP, 0, sizeof(DP)); memset(DP2, 0, sizeof(DP2)); f原创 2014-07-27 15:15:12 · 500 阅读 · 0 评论 -
poj-2533
// 360K 16MS G++#include #include #define MAX 1005int DP[MAX];int array[MAX];int num;void solve() { memset(DP, 0, sizeof(DP)); int maxLength = -1; for (int i = 0; i < num; i++) { if原创 2014-07-27 14:20:33 · 546 阅读 · 0 评论 -
poj-3140
//10344K 391MS C++#include #include #include const long long MAX = 100005;long long adjacentListHead[MAX];long long studentTotalSum;struct Node{ long long studentNum;};long long原创 2014-09-04 17:56:49 · 561 阅读 · 0 评论 -
PKU-DP列表
From: http://gisyhy.blog.163.com/blog/static/1293903432009922103623563/1014 装箱问题1015 Jury Compromise1029 False coin1036 Gangsters1037 A decorative fence1038 Bugs Integrated, Inc.1042 G转载 2014-09-04 14:12:06 · 510 阅读 · 0 评论 -
poj-2231
//264K 47MS C++#include #include #include const int MAX = 10005;long long cowLocation[10005];int cmp(const void * a, const void * b) { return *((long long *)a) - *((long long *)b);}long l原创 2014-09-18 20:59:51 · 562 阅读 · 0 评论 -
poj-1947
//540K 32MS G++#include #include using namespace std;const int MAX = 155;int DPRemoveMin[MAX][MAX];int DPRemoveMinRangeFrom[MAX][MAX];int childListHead[MAX];struct Node { int par原创 2014-09-06 21:26:35 · 568 阅读 · 0 评论 -
poj-2342
//392K 16MS C++#include #include using namespace std;const int MAX = 6005;struct Employee { int supervisorId; int val; int nextBroId;};typedef struct Employee Employee;Emp原创 2014-09-04 10:38:20 · 525 阅读 · 0 评论