
stl
mtxxxx
qq 1149169650
邮箱:huangxin0124@tongji.edu.cn
展开
-
紫书 p108 例题5-1
lower_bound(a,a+n,x):查找“大于或等于x的第一个元素”调用lower_bound之前必须确定序列为有序序列,否则调用出错。返回一个迭代器。 sort,可以是普通数组sort(a,a+n);vector:sort(v.begin(),v.end()) #include #include using namespace std; const int maxn=10000;原创 2016-03-01 23:19:04 · 389 阅读 · 0 评论 -
紫书 p120 第五章例题5-7 丑数
#include #include #include #include using namespace std; long long record[3]={2,3,5}; priority_queue,greater > pq; set s; int main() { long long i,t,x,j; pq.push(1); s.insert(1);原创 2016-03-03 19:09:32 · 380 阅读 · 0 评论