Cod sursa(job #3250414)

Utilizator MikeStrikeAgache Mihai MikeStrike Data 20 octombrie 2024 18:44:26
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.45 kb
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n;
unordered_map<int,int>hash_map;

int main()
{
    int i, task, x;
    fin >> n;
    for(i = 1; i <= n; i++)
    {
        fin >> task >> x;
        if(task == 1) hash_map[x] = 1;
        else if(task == 2) hash_map[x] = 0;
        else fout << hash_map[x] << "\n";
    }
    return 0;
}