Cod sursa(job #3129950)

Utilizator DariusGhercaDarius Gherca DariusGherca Data 16 mai 2023 14:19:55
Problema Hashuri Scor 30
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.67 kb
#include <iostream>
#include <fstream>
#include <bitset>
using namespace std;
const int N = 1e6 + 10;
bitset <N> v;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int main()
{
    int n, key;
    f >> n;
    while(n){
        int x;
        f >> x;
        switch(x){
        case 1:
            f >> x;
            key = x % N;
            v[key] = true;
            break;
        case 2:
            f >> x;
            key = x % N;
            v[key] = false;
            break;
        case 3:
            f >> x;
            key = x % N;
            g << v[key] << "\n";
            break;
        };
        n--;
    }
    return 0;
}