Pagini recente » Monitorul de evaluare | Cod sursa (job #2621768) | Cod sursa (job #1831815) | Cod sursa (job #473082) | Cod sursa (job #2894935)
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
#define MOD 666013
ifstream f("hashuri.in");
ofstream g("hashuri.out");
vector<int> h[MOD];
int main()
{
int n;
f>>n;
for(int i=1;i<=n;i++)
{
int o,x;
f>>o>>x;
if(o==1) {h[x % MOD].push_back(x); continue;}
else if(o==2 && count(h[x % MOD].begin(), h[x % MOD].end(), x)) {h[x % MOD].erase(find(h[x % MOD].begin(), h[x % MOD].end(), x)); continue;}
else if(o==3)count(h[x % MOD].begin(), h[x % MOD].end(), x)?g<<"1\n":g<<"0\n";
}
}