~athorp96/kattis-solutions

451b52f0b2da56047ce3a615ca16551a1ed2fb46 — Andrew Thorp 3 years ago 122a99f
Work on CD
4 files changed, 68 insertions(+), 9 deletions(-)

A cd/A.0.ans
A cd/A.0.in
A cd/A.1.in
M cd/cd.py
A cd/A.0.ans => cd/A.0.ans +1 -0
@@ 0,0 1,1 @@
2

A cd/A.0.in => cd/A.0.in +8 -0
@@ 0,0 1,8 @@
3 3
1
2
3
1
2
4
0 0

A cd/A.1.in => cd/A.1.in +43 -0
@@ 0,0 1,43 @@
10 10
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
10 10
10
11
12
13
14
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0 0

M cd/cd.py => cd/cd.py +16 -9
@@ 28,22 28,29 @@ Algorithm
        print the result

"""
s = set()
while True:
def get_n_m():
    n_m = input()
    if n_m == "0 0":
        exit()
    while n_m != "0 0":
        n_m = input()
        yield n_m


for n_m in get_n_m():
    n_m = n_m.split(' ')
    print(f"n m: {n_m}")

    n = int(n_m[0])
    m = int(n_m[1])

    s = set()
    for i in range(n):
        s.add(input())
        j = input()
        s.add(j)

    print(f"Jack's CDS: {s}")
    a = set()
    for i in range(m):
        s.discard(input())
    print(f"Jill's CDS: {s}")
        j = input()
        if j in s:
            a.add(j)

    print(len(s))
    print(len(a))