赞
踩
- //Dp
- int getMinSteps(int object, int floor)
- {
- if(object < 1 || floor < 1)
- {
- return 0;
- }
- int (*c)[floor+1] = new int[object+1][floor+1];
-
- for(int i=1; i<object; i++){
- for(int j=1; j<=floor; j++)
- c[i][j] = j;
- }
-
- for(int i=2; i<=object; i++)
- {
- for(int j=1; j<floor; j++)
- {
- for(int k=1; k<m; k++)
- {
- c[n][m] = min(c[n][m], max(c[n-1][k-1], c[n][m-k]));
- }
- }
- }
- return c[object][floor];
- }

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。