Cod sursa(job #2539413)
| Utilizator | Data | 5 februarie 2020 20:42:18 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.56 kb |
#include <fstream>
#include <set>
#define mod 100000
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n,i,t,x;
set <int> s[100000];
int main(){
fin>>n;
for(i=1;i<=n;i++){
fin>>t>>x;
if(t==1){
s[x%mod].insert(x/mod);
}
if(t==2){
s[x%mod].erase(x/mod);
}
if(t==3){
if(s[x%mod].find(x/mod)!=s[x%mod].end())
fout<<1<<"\n";
else
fout<<0<<"\n";
}
}
return 0;
}
