-
Notifications
You must be signed in to change notification settings - Fork 68
/
Omakarandpassword.cpp
50 lines (45 loc) · 1.08 KB
/
Omakarandpassword.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
#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
#define tc int t ;cin>>t ;while(t--)
#define pb push_back
#define mp make_pair
#define FOR(i,n) for(int i =0;i<n;i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define tra(a) for(auto it : a )cout<<it<<" " ;
#define all(v) v.begin() , v.end()
#define vi vector<int>
#define vll vector<long long >
#define vpp vector<pair<int , int >>
#define inf INT_MAX
#define minf INT_MIN
#define pi 1.0l*acos(-1) //acos measns cos inverse
#define ss second
#define sz(a) a.size()
#define ff first
int main()
{
ios::sync_with_stdio(0) ;
cin.tie(0) ; cout.tie(0) ;
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
tc
{
int n ;
cin>>n ; vll v(n) ;
FOR(i,n)cin>>v[i] ;
int f= 1 ;
FOR(i,n-1)
{
if(v[i+1]!=v[i])
f=0 ;
}
if(f)
cout<<n<<"\n" ;
else
cout<<"1\n" ;
}
return 0 ;
}