Cod sursa(job #1342393)
| Utilizator | Data | 13 februarie 2015 22:48:49 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.45 kb |
// hashuri
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n;
unordered_map<int, bool> mp;
void read() {
f>>n;
for (int i=1;i<=n;i++) {
int type; f>>type;
int x; f>>x;
if (type == 1) {
mp[x] = 1;
} else if (type == 2) {
mp[x] = 0;
} else if (type == 3) {
g<<mp[x]<<'\n';
}
}
}
int main() {
read();
f.close(); g.close();
return 0;
}