摘要:
点我看题目题意 :中文题,不详述。思路 : 状态转移方程 dp[ i ][ j ] = dp[i-1][k] + fabs(a[ i ][ j ]-a[i-1][k]) ;dp[i][j]代表的是在 i 时刻如果敲第j坐标上的地鼠需要的最小消耗。#include #include #include #include using namespace std ;int a[30][30] ;int dp[1000][510] ;const int INF = 99999999 ;int main(){ int N,K ; while(~scanf("%d %d",&N, 阅读全文
posted @ 2014-03-17 21:37
枫、
阅读(234)
评论(0)
推荐(0)
摘要:
A. Nutstime limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard outputYou haveanuts and lots of boxes. The boxes have a wonderful feature: if you putx(x ≥ 0)divisors (the spacial bars that can divide a box) to it, you get a box, divided intox + 1sections.You 阅读全文
posted @ 2014-03-17 14:01
枫、
阅读(335)
评论(0)
推荐(0)
浙公网安备 33010602011771号