大牛们来看看这道题# JobHunting - 待字闺中
a*r
1 楼
we are given a list of such product (ID) pairs that identify products
belonging to a same category, for example: (1, 5), (7, 2), (3, 4), (4, 8), (
6, 3), (5, 2).
When we analyze that list, we can see that we only have two categories with
4 products, each: (1, 2, 5, 7), (3, 4, 6, 8)
The questions are:
How many categories we have and how many products in each category?
In how many ways can we choose a pair of products so that the two products
come from different categories?
用手画画应该是个图形,可是怎么implement呀?先建个
struct node
{
int key;
vector list;
};
? 可是key怎么选?
belonging to a same category, for example: (1, 5), (7, 2), (3, 4), (4, 8), (
6, 3), (5, 2).
When we analyze that list, we can see that we only have two categories with
4 products, each: (1, 2, 5, 7), (3, 4, 6, 8)
The questions are:
How many categories we have and how many products in each category?
In how many ways can we choose a pair of products so that the two products
come from different categories?
用手画画应该是个图形,可是怎么implement呀?先建个
struct node
{
int key;
vector
};
? 可是key怎么选?