-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpace_Arrays.cpp
More file actions
52 lines (48 loc) · 1.13 KB
/
Space_Arrays.cpp
File metadata and controls
52 lines (48 loc) · 1.13 KB
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
#include <bits/stdc++.h>
using namespace std;
#define m1 1000000007
#define int long long
#define float double
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(c) c.begin(), c.end()
#define mid(l, r) (l + (r - l) / 2)
#define loop(i, a, b) for(int i = (a); i<= (b); i++)
#define loopneg(i, a, b) for(int i = (a); i>= (b); i--)
#define arll(n) long long ar[n]
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int32_t main(){
fast
int t=1;
cin>>t;
while(t--){
int N;
cin>>N;
int ar[N];
for(int i=0; i<N; i++)
{
cin>>ar[i];
}
sort(ar,ar+N);
int count=0,f=0;
for(int i=0; i<N; i++){
if(i+1-ar[i]<0){
f=1;
break;
}
count=count+(i+1-ar[i]);
}
if(f==1){
cout<<"Second"<<endl;
}else{
if(count%2==1){
cout<<"First"<<endl;
}else{
cout<<"Second"<<endl;
}
}
}
}