摘要: Binary String Matching时间限制:3000ms | 内存限制:65535KB难度:3描述Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell how many times does A appear as a substring of B? For example, the text string B is ‘1001110110’ while the pattern string A is ‘11’, you should output 3 阅读全文
posted @ 2013-07-16 15:37 龚细军 阅读(386) 评论(0) 推荐(0) 编辑
摘要: 括号配对问题时间限制:3000ms | 内存限制:65535KB难度:3描述现在,有一行括号序列,请你检查这行括号是否配对。输入第一行输入一个数N(0#include#includetypedef struct NODE{ char a; struct NODE *next ;}Node;int main( void ){ int n,t,flag; Node *head,*p1,*p2; scanf("%d",&t); getchar(); while(t--) { head=NULL; flag=n=0; p1=p2=(Node*)malloc(sizeof(N 阅读全文
posted @ 2013-07-16 11:20 龚细军 阅读(140) 评论(0) 推荐(0) 编辑