Cod sursa(job #1914312)

Utilizator medicinedoctoralexandru medicinedoctor Data 8 martie 2017 16:25:58
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.86 kb
//#include <fstream>
//#include <map>
//
//using namespace std;
//
//ifstream cin ("hashuri.in" );
//ofstream cout("hashuri.out");
//
//map <int, int> M;
//
//int main()
//{
//    int y, x, n, m;
//    cin >> n;
//
//    for (int i = 0; i < n; i++)
//    {
//        cin >> y >> x;
//
//        if (y == 1 && M.find(x) == M.end()) M[x] = ++ m;
//        if (y == 2) M.erase(x);
//        if (y == 3) cout << ((bool)(M.find(x) != M.end())) << '\n';
//    }
//
//    return 0;
//}


#include <iostream>
#include <vector>

using namespace std;

vector <bool> b;

int main()
{
    int n, x, y;
    cin >> n;

    for (int i = 0; i < n; i++)
    {
        cin >> y >> x;
        if (x + 1 > b.size()) b.resize(x + 1);

        if (y == 1) b[x] = true;
        if (y == 2) b[x] = false;
        if (y == 3) cout << b[x] << '\n';
    }
}