Pagini recente » Cod sursa (job #2766992) | Cod sursa (job #1422599) | Cod sursa (job #2815494) | Cod sursa (job #3219463) | Cod sursa (job #3230321)
#include <fstream>
#include <map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
const int mod = 666013;
int n;
map<int, int> a;
int main()
{
f >> n;
for(int i = 1; i <= n; i ++)
{
int op, x; f >> op >> x;
if(op == 1)
a[x % mod] ++;
else if(op == 2 && a[x % mod])
a[x % mod] --;
else if(op == 3)
g << (a[x % mod] > 0) << '\n';
}
return 0;
}