摘要:
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 ; 阅读全文
2013年7月13日 #
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... 阅读全文
摘要:
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 阅读全文