Cod sursa(job #1165397)

Utilizator projectanduFMI Stanescu Andrei Alexandru projectandu Data 2 aprilie 2014 17:39:45
Problema Hashuri Scor 30
Compilator cpp Status done
Runda Arhiva educationala Marime 0.57 kb
#include <iostream>
#include <fstream>
using namespace std;

ifstream d("hashuri.in");
ofstream o("hashuri.out");
const int N=1+1e7;
int x,y;
bool q[N];

int main()
{
    d>>x;
    while(d>>x>>y)
    {
        if(x==1)
        {
            q[y]=true;
            continue;
        }
        if(x==2)
        {
            q[y]=false;
            continue;
        }
        if(x==3)
        {
            if(q[y]==true)
                o<<"1\n";
            else
                o<<"0\n";
            continue;
        }
    }
    return 0;
}