上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 99 下一页

2011年7月31日

最少拦截系统

摘要: #include <stdio.h>#include <string.h>#include <stdlib.h>int main( ){ int dp[10000]; int N, i, j, num, t; while (scanf("%d", &N) != EOF ) { num = 0; for (i = 0; i < N; i++) scanf("%d",&dp[i]); for (i = 0; i < N; i++) { if (dp[i] != -1) { t = dp[i], 阅读全文

posted @ 2011-07-31 12:08 more think, more gains 阅读(132) 评论(0) 推荐(0) 编辑

数塔

摘要: 状态方程: dp[i][j] += max (dp[i-1][j],dp[i-1][j-1]);#include <stdio.h>#include <string.h>#include <stdlib.h>#include <algorithm>using namespace std;int main( ){ int T, N, i, j, t; int dp[110][110]; scanf("%d",&T); while (T--) { t = 0; memset(dp, 0, sizeof(dp)); scan 阅读全文

posted @ 2011-07-31 11:57 more think, more gains 阅读(132) 评论(0) 推荐(0) 编辑

bone collector3

摘要: 一维。。0ms 198kb#include <stdio.h>#include <string.h>#include <stdlib.h>#include <algorithm>using namespace std;int main( ){ int N,T,V,dp[1100],value[1100],volume[1100]; scanf("%d",&T); while (T--) { int i, j; scanf("%d%d",&N,&V); for (i = 1; i &l 阅读全文

posted @ 2011-07-31 11:32 more think, more gains 阅读(102) 评论(0) 推荐(0) 编辑

bone collector1

摘要: 二维。46ms .4936kb#include <stdio.h>#include <string.h>#include <stdlib.h>#include <algorithm>using namespace std; int T, M, N, V, i, j, dp[1100][1100], value[1100], volume[1100];void print( ){ int i, j;for ( i = 0; i <= N; i++) { for ( j = 0; j <= V; j++) printf("%d 阅读全文

posted @ 2011-07-31 11:31 more think, more gains 阅读(136) 评论(0) 推荐(0) 编辑

bone collector

摘要: 滚动数组。二维。。31ms 212kB#include <stdio.h>#include <string.h>#include <stdlib.h>#include <algorithm>using namespace std; int T, M, N, V, i, j, dp[3][1100], value[1100], volume[1100];int main( ){ scanf("%d",&T); while (T--) { scanf("%d%d",&N,&V); mem 阅读全文

posted @ 2011-07-31 11:30 more think, more gains 阅读(106) 评论(0) 推荐(0) 编辑

上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 99 下一页

导航