摘要: 字符串处理的题目;学习了一下string类的一些用法;这个代码花的时间很长,其实可以更加优化;代码: 1 #include 2 #include 3 using namespace std; 4 string dict[114]= {"he","h","li","be","b","c","n","o","f","ne" 5 ,"na","mg"," 阅读全文
posted @ 2013-10-03 19:18 Yours1103 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 题目不难,感觉像是一个拓扑排序,要用双端队列来维护;要注意细节,不然WA到死 = =! 1 #include 2 #include 3 #include 4 #define maxn 100005 5 using namespace std; 6 7 int q[2*maxn],count[2][maxn],tail,head,n,m,in[maxn]; 8 vectorve[maxn]; 9 10 int solve(int lab)11 {12 head=tail=n;13 int cnt=0,cc=0,f=lab;14 for(int i=1;i<=n;i++)... 阅读全文
posted @ 2013-10-03 18:01 Yours1103 阅读(248) 评论(0) 推荐(0) 编辑