# 1190. Reduced ID Numbers （求余）

//这道题不难，关键是要明白题意，题意是输入n个数后，从n开始递增，找出最小的n令输入的每个数对n求余的答案都不相同
#include<iostream>
#include<cstring>
using namespace std;
int num[305];
int flag[99999];
int main()
{
int t;
cin>>t;
while(t--)
{
int G;
cin>>G;
for(int i=0;i<G;i++)
cin>>num[i];
int min=G;
while(true)
{
memset(flag,0,sizeof(flag));
int ok=1;
for(int i=0;i<G;i++)
{
int mod=num[i]%min;
if(flag[mod])
{
ok=0;
break;
}
else
flag[mod]=1;
}
if(ok)
{
cout<<min<<endl;
break;
}
min++;
}
}
return 0;
}

#### Reduced ID Numbers (memset 的关键用处）

2014-09-06 10:20:46

#### 1190. Reduced ID Numbers

2013-11-04 15:51:44

#### 1190. Reduced ID Numbers

2010-07-15 22:52:00

#### Sicily 1190. Reduced ID Numbers

2013-07-17 22:51:31

#### *寒假水105——Reduced ID Numbers

2018-02-24 00:45:48

#### sicily 1190. Reduced ID Numbers

2015-11-19 17:11:16

#### 解题报告 之 POJ2769 Reduced ID Numbers

2015-05-11 12:18:36

#### Reduced ID Numbers

2018-01-19 20:23:44

#### //水题使人愉悦//Reduced ID Numbers ------一P

2018-02-11 17:59:18

#### Sicily 1190. Reduced ID Numbers 简单哈希

2016-01-09 12:26:57