当时练习的时候,没有想清楚。 (#-.-)
这题挺水的,把状态转移方程推出来就知道写了。
Code:
#include <stdio.h>
#include <string.h>
#define min(a,b) a<b ? a:b
const int maxn = 115;
const int INF = 1000000000;
int f[maxn][maxn];//f[i][j]表示第i个阶段耗费j点力量时,的最小耗时。
int main()
{
int i, j, t, n, m, t1, t2, t3, f1, f2;
scanf("%d", &t);
while (t--) {
scanf("%d%d", &n, &m);
for (i = 0; i <= n; i++)
for (j = ......
阅读全文