Redian新闻
>
问一道matching的算法题目,谢谢!!
avatar
问一道matching的算法题目,谢谢!!# JobHunting - 待字闺中
c*z
1
这种matching题目应该使用什么算法,谢谢大家了!
we have to do now is implement a program
that assigns each product to a given customer while maximizing the total
suitability
of all products to all customers. so we need you to implement the matching
program.
The algorithm is:
• If the length of the product name is even, the base suitability
score (SS) is the
number of vowels in the customer’s name multiplied by 1.5.
• If the length of the product name is odd, the base SS is the number
of consonants
in the customer’s name multiplied by 1.
• If the length of the product name shares any common factors (besides
1) with the
length of the customer’s name, the SS is increased by 50% above the base SS.
Write a program that assigns products to sites in a way that maximizes the
total SS
over the set of customers.Each customer can only have one product and each
product
can only be offered to one customer. Your program should run on the command
line and
take as input two newline separated files, the first containing the names of
the
products and the second containing the names of the customers. The output
should be
the total SS and a matching between customers and products. You do not need
to worry
about malformed input, but you should certainly handle both upper and lower
case
names.
avatar
b*h
2
似乎可以用bipartite graph matching。

【在 c**z 的大作中提到】
: 这种matching题目应该使用什么算法,谢谢大家了!
: we have to do now is implement a program
: that assigns each product to a given customer while maximizing the total
: suitability
: of all products to all customers. so we need you to implement the matching
: program.
: The algorithm is:
: • If the length of the product name is even, the base suitability
: score (SS) is the
: number of vowels in the customer’s name multiplied by 1.5.

avatar
g*s
3
就是简单的二分图最大匹配啊
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。