ZOJ Monthly, August 2012 3643 Keep Deleting
摘要:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3643题意:给出A串和B串,删除B串中的A串。思路:栈+暴力,strcmp函数比较的时候,如果不相等就会马上退出,这样最坏的时间复杂度是O(maxn/256*(1+256)*256/2)。ps:不知道官方解题是怎么样弄的。View Code #include<stdio.h>#include<string.h>#define maxn 512005char as[maxn],bs[2000],st[maxn];int ans,tp;int main 阅读全文
posted @ 2012-08-26 21:41 aigoruan 阅读(196) 评论(0) 推荐(0)