企业网站的推广方式,网站建设需求单,微信里的小程序占内存吗,什么项目适合新手创业J-408之数据结构_北京信息科技大学第十五届程序设计竞赛#xff08;同步赛#xff09; (nowcoder.com) 思维好题#xff0c;直接用两个set存没出现的数字就好了 // Problem: 408之数据结构
// Contest: NowCoder
// URL: https://ac.nowcoder.com/acm/contest/68572/J
// Me…
J-408之数据结构_北京信息科技大学第十五届程序设计竞赛同步赛 (nowcoder.com) 思维好题直接用两个set存没出现的数字就好了 // Problem: 408之数据结构
// Contest: NowCoder
// URL: https://ac.nowcoder.com/acm/contest/68572/J
// Memory Limit: 524288 MB
// Time Limit: 4000 ms
//
// Powered by CP Editor (https://cpeditor.org)#includebits/stdc.h
using namespace std;
using lllong long;
const int N 1e610;
int n,q;
setinta,b;
void solve()
{cinnq;for(int i0;iN;i){if(i1)a.insert(i);else b.insert(i);}int x,mask;for(int i1;in;i){cinx;if(a.count(x))a.erase(x);if(b.count(x))b.erase(x);}while(q--){int op;cinop;if(op1){cinxmask;if(mask)a.erase(a.lower_bound(x));else b.erase(b.lower_bound(x));}else{cinmask;if(mask)cout*(a.begin())\n;else cout*(b.begin())\n;}}}int main()
{ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);int _;_ 1;while(_--)solve();return 0;
}