Cod sursa(job #3297433)
| Utilizator | Data | 22 mai 2025 16:53:20 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.47 kb |
#include <stdio.h>
#include <unordered_set>
int main() {
FILE *fin = fopen( "hashuri.in", "r" );
FILE *fout = fopen( "hashuri.out", "w" );
int q;
std::unordered_set<int> mata;
for( scanf( "%d", &q ); q--; ){
int task, x;
fscanf( fin, "%d%d", &task, &x );
if( task == 1 )
mata.insert( x );
else if( task == 2 )
mata.erase( x );
else
fprintf( fout, "%d\n", int(mata.count( x )) );
}
fclose( fin );
fclose( fout );
return 0;
}
