avatar
Re: 这个题怎解?# BrainTeaser - 大脑工作室
N*D
1
【 以下文字转载自 JobHunting 讨论区 】
发信人: NND (NND), 信区: JobHunting
标 题: Re: 这个题怎解?
发信站: BBS 未名空间站 (Sat Nov 3 21:02:53 2007), 转信
简单点说,就是n个数,a1,a2,....,an,每个数都属于某一个group,需要测试这n个数
中受否存在一半或者以上的数属于同一个group
能允许的操作compare(ai,aj),告诉你是否是同一个组。
要求时间O(n)
A bank has a collection of n bank cards that they’ve confiscated, suspectin
g them of being used in a fraud. Each bank card corresponds to a unique acco
unt in the bank. Each account can have many cards corresponding to it, and w
e’ll say that two bank cards are e
avatar
N*D
2
这里高手多,借人气一问,谢谢

suspectin
acco

【在 N*D 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: NND (NND), 信区: JobHunting
: 标 题: Re: 这个题怎解?
: 发信站: BBS 未名空间站 (Sat Nov 3 21:02:53 2007), 转信
: 简单点说,就是n个数,a1,a2,....,an,每个数都属于某一个group,需要测试这n个数
: 中受否存在一半或者以上的数属于同一个group
: 能允许的操作compare(ai,aj),告诉你是否是同一个组。
: 要求时间O(n)
: A bank has a collection of n bank cards that they’ve confiscated, suspectin
: g them of being used in a fraud. Each bank card corresponds to a unique acco

avatar
h*k
3
就 a1,a2 比,a3,a4比,如果没有一组相同,return false
如果有相同的,把相同的取出来,跟如果没比的an放一起再比
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。