5-18 Hashing - Hard Version (30分)
Given a hash table of size N, we can define a hash function . Suppose that the linear probing is used to solve collisions, we can easily obtain the status of the hash table with a given sequence of input numbers.
However, now you are asked to solve the reversed problem: reconstruct the input sequence from the given status of the hash table. Whenever there are multiple choices, the smallest number is always taken.
Input Specification:
Each input file contains one test case. For each test case, the first line contains a positive integer

该博客讨论了一个从给定哈希表状态还原输入序列的问题。输入包含哈希表大小N和N个整数,负数表示空单元格。任务是重构唯一的输入序列,当有多种选择时,选择最小的数。
最低0.47元/天 解锁文章
528

被折叠的 条评论
为什么被折叠?



