-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1249A-Yet Another Dividing into Teams.cpp
54 lines (44 loc) · 1.39 KB
/
1249A-Yet Another Dividing into Teams.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
//Definition Section
//--------------------------------------------------------------
#define fl(i,x,y) for(int i=x; i<y; i++)
#define flc(i,x,y,z) for(int i=x; i<y; i+=z)
#define nl cout<<endl
#define vsort(v) sort(v.begin(), v.end());
#define vsortg(v) sort(v.begin(), v.end(), greater<int>());
#define getIntoVc(v,n) { while(n--) {long long yyy; cin>>yyy; v.push_back(yyy);}}
#define all(x) x.begin(),x.end()
#define pb push_back
#define printvc(v) for(int i=0; i<v.size(); i++) cout<<v[i]<<" ";
#define strTOint(s,n) {stringstream sst; sst<<s; sst>>n;}
#define intTOstr(n,s) {stringstream sst; sst<<n; sst>>s;}
#define ff first
#define ss second
#define DouraMama {ios::sync_with_stdio(false); cin.tie(NULL);}
#define prefixSum(v,prefix) {long long sum=0; for(int i=0; i<v.size(); i++) {sum+=v[i];prefix.push_back(sum);}}
//--------------------------------------------------------------
int main()
{ DouraMama
ll n,m,t,i,j,k,x,y,z,a,b,c,cnt=0,ans=0;
bool flag=false;
string s,s1,s2,s3;
cin>>t;
while(t--) {
flag=true;
cin>>n;
vector<ll> v;
getIntoVc(v,n);
vsort(v);
fl(i,0,v.size()-1) {
if(v[i+1]-v[i]==1) {
cout<<2<<endl;
flag=false;
break;
}
}
if(flag) cout<<1<<endl;
}
//cout<<endl; main();
}