Pagini recente » Cod sursa (job #294902) | Cod sursa (job #2103912) | Cod sursa (job #1651924) | Cod sursa (job #2174387) | Cod sursa (job #2764645)
#include <fstream>
#include <map>
using namespace std;
const int modulo = 666013;
map<int, int> cnt[modulo+10];
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int main(){
int n;
f >> n;
for(int i = 0 ; i< n; ++ i){
int cd, x;
f >> cd >> x;
int y = x % modulo;
if(cd == 1){
cnt[y][x]++;
}
if(cd == 2){
if(cnt[y].count(x) == 0) continue;
else cnt[y].erase(x);
}
if(cd == 3){
if(cnt[y].count(x) == 0) g << 0;
else g << 1;
g << '\n';
}
}
return 0;
}