第一道动态规划。。书中给的状态转移的设计感觉很巧妙
要注意下数组大小避免RE。
Run Time: 0.032s
#define UVa "LT9-1.1025.cpp" //A Spy in the Metro
char fileIn[30] = UVa, fileOut[30] = UVa;
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
//Global Variables. Reset upon Each Case!
const int maxt = 4000 + 10, maxn = 50 + 10, maxm = 50 + 10, INF = 100000000;
int N, T, M1, M2, t[maxn], d[maxm], e[maxm];
int has_train[maxt][maxn][2];
int dp[maxt]......
阅读全文