当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2769:Reduced ID Numbers

题目描述
T. Chur teaches various groups of students at university U. Every U-student has a unique Student Identification Number (SIN). A SIN s is an integer in the range 0 ≤ s ≤ MaxSIN with MaxSIN = 106-1. T. Chur finds this range of SINs too large for identification within her groups. For each group, she wants to find the smallest positive integer m, such that within the group all SINs reduced modulo m are unique.
输入解释
On the first line of the input is a single positive integer N, telling the number of test cases (groups) to follow. Each case starts with one line containing the integer G (1 ≤ G ≤ 300): the number of students in the group. The following G lines each contain one SIN. The SINs within a group are distinct, though not necessarily sorted.
输出解释
For each test case, output one line containing the smallest modulus m, such that all SINs reduced modulo m are distinct.
输入样例
2
1
124866
3
124866
111111
987651
输出样例
1
8

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2769

最后修改于 2020-10-29T06:42:47+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000 65536