Cod sursa(job #2988554)

Utilizator matwudemagogul matwu Data 4 martie 2023 21:16:40
Problema Hashuri Scor 30
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.71 kb
#include <bits/stdc++.h>
using namespace std;
const int mod1 = 4e4 + 7, mod2 = 1e4 + 13;
vector<bitset<mod2>> v(mod1);
int n;
int main(){
    cin.tie(0)->sync_with_stdio(0);
    ifstream fin("hashuri.in");
    ofstream fout("hashuri.out");
    fin >> n;
    while(n--){
        int t, x;
        fin >> t >> x;
        if(t == 1){
            int art = x % mod1;
            int vrt = x % mod2;
            v[art][vrt] = 1;
        }
        else if(t == 2){
            int art = x % mod1;
            int vrt = x % mod2;
            v[art][vrt] = 0;
        }
        else{
            int art = x % mod1;
            int vrt = x % mod2;
            fout << v[art][vrt] << '\n';
        }
    }
}