SP33299 ADAFUROW - Ada and Furrows
Description
As you might already know, Ada the Ladybug is a farmer. She has multiple furrows in which she grows vegetables. She also never grows multiple vegetables of the same kind in the same furrow. Ada sometime palnts a new vegetable, harveest a vegetable or asks for some aspect which two different furrows have in common (described in input).
Input Format
The first line of input will contain **1 , the number of queries.**
Each of the next **Q** lines will contain **? x y**: **0 , and **?** is one of: **+ - v ^ ! \\** with following meaning:**
+: Plants vegetable of kind **y** to furrow number **x** (note that there will never be multiple vegetables of the same kind in the same furrow)
-: Harvests vegetable of kind **y** from furrow number **x** (note that there will always be a vegetable of that kind)
v: Finds out how many kinds of vegetables there are in furrows **x** and **y**.
^: Finds out how many kinds of vegetable are in both furrows (**x, y**)
!: Find out how many kinds of vegetables are in **x** and **y** **BUT** not in both of them at once.
\\: Find out how many kinds of vegetable are in **x** but not in **y**
Output Format
For each query of the last four kinds, output the proper answer.