由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问一道matching的算法题目,谢谢!!
相关主题
P家面经公司比较
贡献一个phone interview (运筹)一道面试算法题
来道heard on the street上的题一道有关Graph的面试题
Google interview question请问一道题--给一个正方形矩阵,每个元素要么黑色要么白色,请找出最大的纯色子矩阵
问个面试题算法--一个MXN matrix (0's and 1's)内求最大 rectangle(1's)
Google 电面 algorithm 问题 (转载)BB CAREERCUP 一道题
请教一道Google面试题问个google面试题(3)
如何计算实际到手工资?问一下那道买卖股票的题目
相关话题的讨论汇总
话题: ss话题: customer话题: product话题: matching话题: name
进入JobHunting版参与讨论
1 (共1页)
c**z
发帖数: 669
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.
b********h
发帖数: 119
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.

g***s
发帖数: 3811
3
就是简单的二分图最大匹配啊
1 (共1页)
进入JobHunting版参与讨论
相关主题
问一下那道买卖股票的题目问个面试题
探讨一个面试问题,难道这是文化差异?Google 电面 algorithm 问题 (转载)
ihas1337一道题没看懂请教一道Google面试题
急问:有谁了解 Maxim Integrated 这个公司?如何计算实际到手工资?
P家面经公司比较
贡献一个phone interview (运筹)一道面试算法题
来道heard on the street上的题一道有关Graph的面试题
Google interview question请问一道题--给一个正方形矩阵,每个元素要么黑色要么白色,请找出最大的纯色子矩阵
相关话题的讨论汇总
话题: ss话题: customer话题: product话题: matching话题: name