这两段代码有什么区别吗
constexpr qnf{30},inf{1<<qnf};
map<int,int> mp;
int get(int pos) {
int val = mp.count(pos) ? mp[pos] : 0, l = prev(mp.lower_bound(pos))->second;
if (l < 0) {
val--;
}
while (val < 0) {
val += 1 << 30;
}
return val;
}
int get2(int k) {
auto it{mp.find(k)};
auto wq{(it==mp.end()?0:it->second)-(prev(it)->second<0)};
if (qwq<0) qwq+=inf;
return qwq;
}