Cod sursa(job #3250413)

Utilizator MikeStrikeAgache Mihai MikeStrike Data 20 octombrie 2024 18:43:03
Problema Hashuri Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.42 kb
#include <iostream>
#include <fstream>
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;
}