Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //3750
- var
- a, b, c: set of longint;
- z, y, x: longint;
- f1: text;
- begin
- assign(f1, 'input.txt');
- reset(f1);
- a := [];
- b := [];
- while not eoln(f1) do
- begin
- read(f1, x);
- include(a, x);
- end;
- readln(f1);
- while not eoln(f1) do
- begin
- read(f1, z);
- include(b, z);
- end;
- y := 0;
- c := a * b;
- foreach var l in c do
- y := y + 1;
- writeln(y);
- end.
- //3751
- var
- a, c, b: set of longint;
- y, l, x, i: integer;
- f1: text;
- begin
- assign(f1, 'input.txt');
- reset(f1);
- a := [];
- b := [];
- while not eoln(f1) do
- begin
- read(f1, x);
- include(a, x);
- end;
- readln(f1);
- while not eoln(f1) do
- begin
- read(f1, y);
- include(b, y);
- end;
- l := 0;
- c := a * b;
- foreach var s in c do
- l := l + 1;
- for i := 1 to 100000 do
- if i in c then write(i, ' ');
- end.
- //3453
- var
- a: set of longint;
- i, j, n, k, l, z: integer;
- s: string;
- f1: text;
- begin
- z := 0;
- assign(f1, 'output.txt');
- rewrite(f1);
- a := [];
- readln(n);
- for i := 1 to n do
- begin
- readln(s);
- if (s[1] = 'A') then
- begin
- delete(s, 1, 4);
- val(s, k, l);
- if k in a then
- include(a, k)
- else
- begin
- include(a, k); z := z + 1;
- end;
- end;
- if (s[1] = 'P') then
- begin
- delete(s, 1, 8);
- val(s, k, l);
- if k in a then writeln(f1, 'YES')
- else writeln(f1, 'NO');
- end;
- if (s[1] = 'C') then
- begin
- writeln(f1, z);
- end;
- end;
- close(f1);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement