Cod sursa(job #1799937)
Utilizator | Data | 7 noiembrie 2016 01:09:59 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.49 kb |
#include <fstream>
#include <unordered_map>
std::ifstream in ( "hashuri.in" );
std::ofstream out( "hashuri.out" );
std::unordered_map<int, int> mm;
int main( int argc, const char *argv[] ) {
std::ios::sync_with_stdio( false );
int n; in >> n;
for( int i = 1; i <= n; i ++ ) {
int t, x; in >> t >> x;
switch( t ) {
case 1: { mm[x] = 1; break; }
case 2: { mm[x] = 0; break; }
case 3: { out << mm[x] << "\n"; break; } } }
return 0; }