Cod sursa(job #3151607)

Utilizator andiRTanasescu Andrei-Rares andiR Data 21 septembrie 2023 23:53:09
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.8 kb
#include <iostream>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <unordered_map>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <iomanip>
#include <vector>
#include <bitset>

#pragma GCC optimize("O3")
#define fi first
#define se second
#define pb push_back
#define pf push_front

using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
typedef long long ll;
const ll Nmax=2e5+5, inf=1e9+5;
using pii=pair<int, int>;

int n;
unordered_map<int, bool> mp;
int main()
{
    fin>>n;
    int nr;
    char ch;
    for (int i=0; i<n; i++){
        fin>>ch>>nr;
        if (ch=='1')
            mp[nr]=1;
        else if (ch=='2')
            mp[nr]=0;
        else fout<<mp[nr]<<'\n';
    }
    return 0;
}