-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcheckStrictSubset.py
89 lines (88 loc) · 1.25 KB
/
checkStrictSubset.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
__author__ = 'Sanjay'
#
# Example:
# Set([1,3,4])
# ([1,3,4])
# is a strict superset of set([1,3])
# ([1,3])
# .
# Set([1,3,4])
# ([1,3,4])
# is not a strict superset of set([1,3,4])
# ([1,3,4])
# .
# Set([1,3,4])
# ([1,3,4])
# is not a strict superset of set([1,3,5])
# ([1,3,5])
# .
#
#
# Input Format
#
#
# The first line contains the space separated elements of set A
# A
# .
# The second line contains integer N
# N
# , the number of other sets.
# The next N
# N
# lines contains the space separated elements of the other sets.
#
# Constraints
#
# 0<len(set(A))<501
# 0<len(set(A))<501
#
# 0<N<21
# 0<N<21
#
# 0<len(otherSets)<101
# 0<len(otherSets)<101
#
#
#
#
# Output Format
#
#
# Print True if set A
# A
# is a strict superset of all other N
# N
# sets. Otherwise, print False.
#
#
# Sample Input
#
# 1 2 3 4 5 6 7 8 9 10 11 12 23 45 84 78
# 2
# 1 2 3 4 5
# 100 11 12
#
#
#
# Sample Output
#
# False
#
#
#
# Explanation
#
#
# Set A
# A
# is the strict superset of the set([1,2,3,4,5])
# ([1,2,3,4,5])
# but not of the set([100,11,12])
# ([100,11,12])
# because 100
# 100
# is not in set A
# A
# .
# Hence, the output is False.
print [all([A > B for B in [set(raw_input().split()) for _ in xrange(int(raw_input()))]]) for A in [set(raw_input().split())]][0]