Cod sursa(job #325078)
Utilizator | Adrian Toncean madflame | Data | 18 iunie 2009 20:15:04 |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva educationala | Marime | 0.48 kb |
Program Hashuri;
Const
p = 181081;
Var
h: array[1..p] of Boolean;
f, g: Text;
i, n, v: Longint; o: Byte;
Function Ff(a: LongInt): LongInt;
Begin
Ff:=a mod p;
End;
BEGIN
Assign(f,'hasuri.in'); Reset(f);
Assign(g,'hasuri.out'); ReWrite(g);
ReadLn(f,n);
For i:=1 to n do
Begin
ReadLn(f,o,v);
Case o of
1: h[ff(v)]:=true;
2: h[ff(v)]:=false;
3: If h[ff(v)] then WriteLn(g,'1') Else WriteLn(g,'1');
End;
End;
Close(f); Close(g);
END.