Problem C. Set

Input file:Standard input   Time limit:1 sec
Output file:Standard output   Memory limit:512 Mb

Statement

You are to implement class Set in which the basic operations on sets are implemented:

Set Union(const Set&) const,

Set Intersection(const Set&) const,

Set Difference(const Set&) const,

Set SymmetricDifference(const Set&) const.

It is also necessary to implement a constructor Set(const std::vector&) and functions for adding, removing and checking the presence of an element in the set:

void Add(int64_t),

void Remove(int64_t), bool Contains(int64_t) const.

Also, implement the method std::vector Data() const that will be used to access the elements of the set.

The class is supposed to be used to store integers of type int64_t. For storing items you should use std::vector with the appropriate template parameter

Materials

main.cpp

task.xml

Output format

The file with the solution must contain only the implementation of the described class, without a main


0.192s 0.014s 17