Cod sursa(job #1120799)
| Utilizator | Data | 25 februarie 2014 10:13:51 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.44 kb |
#include <stdio.h>
#include <set>
using namespace std;
multiset <int> S;
int main() {
freopen ("hashuri.in", "r", stdin);
freopen ("hashuri.out", "w", stdout);
int N, i, opt, x;
scanf ("%d", &N);
for (i = 1; i <= N; ++i) {
scanf ("%d %d", &opt, &x);
if (opt == 1) S.insert(x);
if (opt == 2) S.erase(x);
if (opt == 3) printf ("%d\n", S.count(x) != 0);
}
return 0;
}
