From 1a8e1e68759611a66ae116771da5f376c95a3b9f Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Sun, 12 Feb 2017 16:18:20 +0700 Subject: Update others/volume1 --- others/volume1/031.pas | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 others/volume1/031.pas (limited to 'others/volume1/031.pas') diff --git a/others/volume1/031.pas b/others/volume1/031.pas new file mode 100644 index 0000000..d87ad88 --- /dev/null +++ b/others/volume1/031.pas @@ -0,0 +1,28 @@ +var + n, m, i, j, k, l: int16; + a: array of int16; + +begin + readln(n, m); + setlength(a, m); + for i := 0 to m - 1 do + a[i] := 0; + for i := 1 to n do + begin + read(k); + for j := 1 to k do + begin + read(l); + inc(a[l - 1]) + end + end; + k := 0; + for i := 0 to m - 1 do + if a[i] = n then + inc(k); + l := 0; + for i := 0 to m - 1 do + if a[i] = 0 then + inc(l); + writeln(k, ' ', l) +end. -- cgit 1.4.1