摘要: HDU 1711Number Sequence(模板题)#include const int MAXN = 1000010;const int MAXL = 10010;int N, M;int textS[MAXN];int tarS[MAXL];int next[MAXL];void GetNextVal( int* s, int* nextval, int len ){ int i = 0, j = -1; nextval[0] = -1; while ( i #include #include const int MAXN = 1000010;const int MA... 阅读全文
posted @ 2013-07-22 21:19 冰鸮 阅读(285) 评论(0) 推荐(0)
摘要: 跟 UVa1474 - Evacuation Plan 一个题,但是在杭电上能交过,在UVa上交不过……不知道哪里有问题……将施工队位置和避难所位置排序。dp[i][j] 代表前 i 个避难所收留前 j 个施工队。dp[i][j] = min( dp[i - 1][j - 1], dp[i][j - 1] ) + abs( b[i] - a[j] );内存卡的比较死,要用滚动数组,并且记录路径的path[i][j]只能用bool型。MLE了四五次OTL…… 1 #include 2 #include 3 #include 4 #include 5 6 #define LL... 阅读全文
posted @ 2013-07-22 10:40 冰鸮 阅读(295) 评论(0) 推荐(0)