Cod sursa(job #1909924)

Utilizator Zamfirescuste2Zamfirescu Stefan Zamfirescuste2 Data 7 martie 2017 14:42:30
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.48 kb
#include <fstream>
#include <map>
using namespace std;
map <int,int> mp;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n,op,x,i;
int main()
{
    f >> n;
    for ( i = 1; i <= n; i++ )
    {
        f >> op >> x;
        if ( op == 1 )
            mp[x] = 1;
        if ( op == 2)
            mp[x] = 0;
        if ( op == 3 && mp[x] == 1)
            g << 1 << "\n";
        if ( op == 3  && mp[x] == 0)
            g << 0 << "\n";
    }
    return 0;
}