Cod sursa(job #2258820)
Utilizator | Data | 12 octombrie 2018 10:58:56 | |
---|---|---|---|
Problema | Hashuri | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.4 kb |
#include <fstream>
using namespace std;
char f[1000001];
int t, x, n, i;
int main () {
ifstream fin ("hashuri.in");
ofstream fout("hashuri.out");
fin>>n;
for (i=1;i<=n;i++) {
fin>>t>>x;
if (t == 1) {
f[x] = 1;
} else
if (t == 2)
f[x] = 0;
else
fout<<(int)f[x]<<"\n";
}
}