Cod sursa(job #3319006)
| Utilizator | Data | 30 octombrie 2025 11:49:53 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 30 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.53 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
const int HASH_MAX = 1000007;
int n, op, x;
int has(int a){
return a % HASH_MAX;
}
bool fr[HASH_MAX+1];
int main()
{
fin >> n;
for(int i = 1; i <= n; i++){
fin >> op >> x;
if(op == 1){
fr[has(x)] = 1;
}
else if(op == 2){
fr[has(x)] = 0;
}
else{
fout << fr[has(x)] << "\n";
}
}
return 0;
}
