摘要: 题目:http://poj.org/problem?id=3007题目不难,,,如果用STL的话会很简单,但会TLE 后来我敲了一个tri树。。爆内存。。又改成哈希以后结果。。。还是TLE。。。后来看的别人的报告,,,结果是他们用的是指针数组,我的不是。。。还是指针快啊。。代码:View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 char str[10][81]; 6 int num; 7 int len; 8 cons 阅读全文
posted @ 2013-02-27 16:31 琳&leen 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 题目:http://poj.org/problem?id=3096注:用G++提交。。。如果用c++提交或CE View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<map> 5 using namespace std; 6 7 int main() 8 { 9 char str[85];10 11 12 while(scanf("%s",str)!=EOF)13 {14 if(str[0]=='*') 阅读全文
posted @ 2013-02-27 11:23 琳&leen 阅读(154) 评论(0) 推荐(0) 编辑