流水依依

希望朋友们有个好的身体,开开心心工作与学习。

博客园 首页 新随笔 联系 订阅 管理
上一页 1 ··· 10 11 12 13 14

2013年7月13日 #

摘要: for(int i=0;i<=10;i++) num[i]=i ;fill(num+1,num+1+5,2) ;for(int i=0;i<=10;i++) printf("%d %d\n",i,num[i]) ; fill(A+i,A+i+k,x) ; 将 [i ,i+k) 区间赋值为 x ; 阅读全文
posted @ 2013-07-13 14:40 流水依依 阅读(342) 评论(0) 推荐(0) 编辑

2013年7月12日 #

摘要: TroubleTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3526Accepted Submission(s): 1113Problem DescriptionHassan is in trouble. His mathematics teacher has given him a very difficult problem called 5-sum. Please help him.The 5-sum... 阅读全文
posted @ 2013-07-12 17:53 流水依依 阅读(304) 评论(0) 推荐(0) 编辑

摘要: unique函数的功能是:去除相邻的重复元素(只保留一个)。函数参数:unique(first,last,compare);//first为容器的首迭代器,last为容器的末迭代器,compare为比较函数(可略写)。 int N ; while(cin>>N){ for(int i=1 ;i>num[i] ; sort(num+1,num+1+N) ; //先排序 int M=unique(num+1,num+1+N)-(num+1) ; cout<<M<<endl ; for(int i=1 ;i<=M ;i++) cout<<n 阅读全文
posted @ 2013-07-12 12:23 流水依依 阅读(196) 评论(0) 推荐(0) 编辑

上一页 1 ··· 10 11 12 13 14