Cod sursa(job #724015)
| Utilizator | Data | 26 martie 2012 09:55:26 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.48 kb |
#include<fstream>
#define _B 8388608
using namespace std;
int main()
{
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
static bool hash_t[_B];
int nOp; fin>>nOp;
for (int i=1;i<=nOp;i++)
{
int op, val;
fin>>op>>val;
switch (op)
{
case 1: hash_t[val%_B]=1; break;
case 2: hash_t[val%_B]=0; break;
case 3: fout<<hash_t[val%_B]<<'\n';
}
}
return 0;
}
