Cod sursa(job #1649106)
| Utilizator | Data | 11 martie 2016 12:35:26 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.54 kb |
#include <fstream>
#include <map>
typedef long long ll;
using namespace std;
map <ll, int> m;
ll x;
int tip, n;
int main()
{
ifstream in("hashuri.in");
ofstream out("hashuri.out");
in>>n;
for(int i = 1; i <= n; ++i){
in>>tip>>x;
if(tip == 1){
m[x]++;
}
if(tip == 2){
if(m[x]) m[x]--;
}
if(tip == 3){
if(m[x]) out<<"1\n";
else out<<"0\n";
}
}
in.close();
out.close();
return 0;
}
