Cod sursa(job #2038763)
| Utilizator | Data | 13 octombrie 2017 23:10:38 | |
|---|---|---|---|
| Problema | Stramosi | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.63 kb |
#include <fstream>
#include <map>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
const int maxim = 666013;
map <int, int> f[666025];
int main()
{
int n, op;
long long x;
fin>>n;
while ( n-- )
{
fin>>op>>x;
int h = x % maxim;
if ( op == 1 )
f[h][x]++;
if ( op == 2 )
if ( f[h].count(x) != 0 )
f[h].erase(x);
if ( op == 3 )
{
if ( f[h].count(x) != 0 )
fout<<"1"<<'\n';
else
fout<<"0"<<'\n';
}
}
}
