摘要: 括号配对问题时间限制:3000ms | 内存限制:65535KB难度:3描述现在,有一行括号序列,请你检查这行括号是否配对。输入第一行输入一个数N(0 2 #include 3 using namespace std; 4 struct Stack{ 5 char *stack; 6 int top; 7 }; 8 void init(Stack &S){ //初始化栈 9 S.stack=new char[10000];10 S.top=-1;11 }12 void Push(Stack &S,char &ch){ ... 阅读全文
posted @ 2014-03-13 19:35 HRuinger 阅读(304) 评论(0) 推荐(1)
摘要: 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 @ 2014-03-13 15:29 HRuinger 阅读(627) 评论(0) 推荐(0)