vector去重
unique(a.begin(),a.end());
返回一段没有重复的数组的末尾
得到去重后的数组:
a.erase(unique(a.begin(),a.end()),a.end());
二分推荐写法
int l = 1,r = 1e9,ans;
while(l <= r) {
int mid = (l + r) >> 1;
if(check(mid)) {
ans = mid;
l = mid + 1;
}
r = mid - 1;
}
快速幂
int qpow(int a,int b) {
int res = 1;
while(b > 0) {
if(b & 1) res = res * a;
a = a * a;
b >> = 1;
}
return res;
}
标签:end,int,res,Day5,mid,寒假,ans,集训
From: https://www.cnblogs.com/Crazyman-W/p/17973882