Pagini recente » Cod sursa (job #415127) | Cod sursa (job #1016529) | Cod sursa (job #435137) | Cod sursa (job #2501615) | Cod sursa (job #325077)
Cod sursa(job #325077)
Program Hashuri;
Const
p = 181081;
Var
h: array[1..p] of Boolean;
f, g: Text;
i, n: 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.