提交 8fcd37bd 编写于 作者: CairBin's avatar CairBin

2022-09-08 修正了STL_N题解

上级 923e4d89
/*
* Description:
* @url:https://vjudge.csgrandeur.cn/contest/513104#problem/N
* @author:CairBin
* @since:2022-09-08
*/
#include <iostream> #include <iostream>
#include <set> #include <set>
#include <algorithm>
using namespace std; using namespace std;
int main() int main()
{ {
int n; int t;
while(cin >> n) while(cin >> t)
{ {
set<int> num; set<int> s;
int a,b; for(int i=0; i<t;i++)
for(int i=0; i<n; i++)
{ {
cin >> a >> b; int query,n;
if(a == 3) cin >> query;
if(query == 1)
{ {
auto iter = find(num.begin(), num.end(), b); cin >> n;
if(iter == num.end()) s.insert(n);
cout << "No" << endl; }
else else if(query == 2)
{
cin >> n;
if(s.find(n)!=s.end())
s.erase(s.find(n));
}
else{
cin >> n;
if(s.find(n)!=s.end())
cout << "Yes" << endl; cout << "Yes" << endl;
else
cout << "No" << endl;
} }
else if(a == 2)
num.erase(find(num.begin(), num.end(), b));
else
num.insert(b);
} }
} }
return 0; return 0;
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册