文章分类 -  STL

摘要:DNA SortingTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 76039Accepted: 30490DescriptionOne measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the letter sequence ``DAABEC'', this m 阅读全文
posted @ 2013-10-13 17:22 heaventouch 阅读(108) 评论(0) 推荐(0) 编辑
摘要:ShoppingTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1400 Accepted Submission(s): 456Problem Description Every girl likes shopping,so does dandelion.Now she finds the shop is increasing the price every day because the Spring Festival is ... 阅读全文
posted @ 2013-09-22 16:23 heaventouch 阅读(391) 评论(0) 推荐(1) 编辑
摘要://并查集+拓扑排序,‘=’ 用并查集处理#include#include#includeusing namespace std;vectornext[10005]; //相当于邻接表int set[10005]; //并查集数组int in[10005]; //记录入度int A[20005],B[20005]; char oper[20005];int n,m,sum;int find(int x){ return set[x]==x?x:find(set[x]);}int merge(int x,int y){ int a=find(x); int b=find... 阅读全文
posted @ 2013-09-12 10:08 heaventouch 阅读(93) 评论(0) 推荐(0) 编辑
摘要://C++容器练习题#include#include#includeusing namespace std;int main(void){ map Ballon; string color,Maxcolor; int n,max; while(cin>>n,n) { Ballon.clear(); while(n--) { cin>>color; Ballon[color]++; } map::iterator it; max=0; for(it=Ballon.begin();it!=Ballon.end();it++) if(it->second > ma 阅读全文
posted @ 2013-09-11 19:26 heaventouch 阅读(94) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示