Cod sursa(job #3130714)

Utilizator johnutddDobrin Ionut johnutdd Data 18 mai 2023 14:34:48
Problema Hashuri Scor 30
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.71 kb
#include <fstream>
#include <vector>

using namespace std;

ifstream f("hashuri.in");
ofstream g("hashuri.out");

const unsigned long long int MAX = 20000001;  

vector<bool> fr(MAX + 1, false);

int main() {
    unsigned long long int n, i, x, y;
    f >> n;

    for (i = 0; i < n; i++)
    {
        f >> x >> y;
        if (x == 1)
        {
            fr[y] = true;
        }
        else if (x == 2)
        {
            fr[y] = false;
        }
        else if (x == 3)
        {
            if (fr[y])
            {
                g << "1" << '\n';
            }
            else
            {
                g << "0" << '\n';
            }
        }
    }

    return 0;
}