-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsets.cpp
More file actions
35 lines (33 loc) · 718 Bytes
/
Copy pathsets.cpp
File metadata and controls
35 lines (33 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int Q;
std::cin>>Q;
std::set<int> s;
for(int i=0; i<Q; i++){
int y,x;
std::cin>>y>>x;
if(1 == y){
s.insert(x);
}
else if(2 == y){
s.erase(x);
}
else if(3 == y){
set<int>::iterator it = s.find(x);
if(it == s.end()){
std::cout<<"No"<<endl;
}
else{
std::cout<<"Yes"<<endl;
}
}
}
return 0;
}