摘要: 跟Vresion 1一样,就是加了高精度。表示高精度还是不熟。。。My Code:#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int N = 1000;void add(int a[], int b[], int res[]){ int i; for(i = N; i >= 0; i--){ res[i] = a[i] + b[i]; } for(i = N; i >= 0; i--){ if(res[i] > 9){ ... 阅读全文
posted @ 2011-10-06 22:02 AC_Von 阅读(305) 评论(0) 推荐(0) 编辑
摘要: /*拿到这题已经好几天了,因为国庆放假回家,家里正好断网,一直没做,今天回到学校终于把它做了。表示已经被dp虐了n久了,还是不得要领,只能守着dp的解题报告过日子。T_T...题意:给一个串mes[], 一个字典dic[],求让这个串完全匹配字典里的串时删除的最小元素个数。思路参考自:http://www.cnblogs.com/lyy289065406/archive/2011/07/31/2122638.html:按mes[]串从后往前匹配,最坏的情况是 dp[i] = dp[i+1] + 1;设 pm是mes[]的下标,如果出现从mes[i] 到 mes[pm] 这一段正好和dic[.. 阅读全文
posted @ 2011-10-06 20:40 AC_Von 阅读(1043) 评论(0) 推荐(0) 编辑