N*D 发帖数: 3641 | 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 |
|