Problem
If and are sets, then their union is the set comprising any elements in either or ; their intersection is the set of elements in both and ; and their set difference is the set of elements in but not in .
Furthermore, if is a subset of another set , then the set complement of with respect to is defined as the set . See the Sample sections below for examples.
Given: A positive integer () and two subsets and of .
Return: Six sets: , , , , , and (where set complements are taken with respect to ).
如果 和 是集合,然后是他们的联合 是一组包括的任何元件或者 要么 ; 他们的交集 是这两个元素的集合 和 ; 和它们的设置差异 是中的元素集 但不在 。
此外,如果 是另一组的子集,那么补集的 关于 被定义为集合 。有关示例,请参见下面的示例部分。
给定:正整数 ()和两个子集 和 的 。
回报:六套:, , , , 和 (其中集合补码相对于 )。
Sample Dataset
10 {1, 2, 3, 4, 5} {2, 8, 5, 10}
Sample Output
{1, 2, 3, 4, 5, 8, 10} {2, 5} {1, 3, 4} {8, 10} {8, 9, 10, 6, 7} {1, 3, 4, 6, 7, 9}