Cod sursa(job #3246319)
| Utilizator | Data | 2 octombrie 2024 18:48:17 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.68 kb |
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_set>
#include <fstream>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main(){
unordered_set<long> hash;
long n;
fin>>n;
for(long i=1; i<=n; i++){
long x,y;
fin>>x>>y;
if(x==1){
if(hash.find(y) == hash.end())
hash.insert(y);
}else if ( x ==2){
if(hash.find(y) != hash.end())
hash.erase(y);
}else if (x== 3){
if(hash.find(y) != hash.end())
fout<<1<<endl;
else
fout<<0<<endl;
}
}
return 0;
}
