{memset技巧}soj1190
来源:互联网 发布:做java工程师有多累 编辑:程序博客网 时间:2024/06/11 02:41
Description
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.
Input
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.
Output
For each test case, output one line containing the smallest modulus m, such that all SINs reduced modulo m are distinct.
Sample Input
211248663124866111111987651
Sample Output
18
暴力
hash:注意memset的大小即可
或者用<set>解决
- {memset技巧}soj1190
- memset memcpy strcpy strcat 用法 技巧
- Memset中无穷大常量的设定技巧
- 2016.7.18 memset小技巧总结
- memset
- memset
- memset
- memset
- memset
- memset
- memset
- memset
- memset
- memset
- memset
- memset
- memset
- memset
- POJ 1251 Jungle Roads
- 题目1512:用两个栈实现队列-九度
- listview 放入 scrollview出现显示问题的解决方法
- Linux2.6--Linus电梯
- hdu 4671——Backup Plan
- {memset技巧}soj1190
- PythonChallenge 挑战之路 Level-26
- 虚拟机与主机之间数据传送
- Java nio 传输文件
- 并查集入门题集 POJ1611 POJ1703 POJ2524 POJ1182
- 【tablespace】一图搞懂extent,segment,block
- elasticsearch的基本用法
- Java--多线程断点下载
- pku 3370 Halloween treats(鸽巢原理)