Cod sursa(job #1415936)
| Utilizator | Data | 6 aprilie 2015 21:41:03 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.47 kb |
#include <iostream>
#include <fstream>
#include <map>
std::map<int,int> m;
int main( int argc, char* argv[] )
{
std::ifstream input("hashuri.in");
std::ofstream output("hashuri.out");
int N;
input >> N;
for ( int i = 0; i < N; ++i )
{
int opt, value;
input >> opt >> value;
if ( opt == 1 )
{
m[value] = 1;
}
if ( opt == 2 )
{
m[value] = 0;
}
if ( opt == 3 )
{
output << m[value] << "\n";
}
}
input.close();
output.close();
return 0;
}
