摘要: Binary String Matching时间限制:3000 ms | 内存限制:65535 KB描述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 @ 2011-09-29 20:19 mtry 阅读(334) 评论(0) 推荐(0)
摘要: 括号配对问题时间限制:3000 ms | 内存限制:65535 KB难度:3描述现在,有一行括号序列,请你检查这行括号是否配对。输入第一行输入一个数N(0<N<=100),表示有N组测试数据。后面的N行输入多组输入数据,每组输入数据都是一个字符串S(S的长度小于10000,且S不是空串),测试数据组数少于5组。数据保证S中只含有"[","]","(",")"四种字符输出每组输入数据的输出占一行,如果该字符串中所含的括号是配对的,则输出Yes,如果不配对则输出No样例输入3[(])(])([[]()])样 阅读全文
posted @ 2011-09-29 19:41 mtry 阅读(480) 评论(0) 推荐(0)
摘要: The TripA group of students are members of a club that travels annually to different locations. Their destinations in the past have included Indianapolis, Phoenix, Nashville, Philadelphia, San Jose, and Atlanta. This spring they are planning a trip to Eindhoven.The group agrees in advance to share e 阅读全文
posted @ 2011-09-29 15:08 mtry 阅读(281) 评论(0) 推荐(0)