Advertisement
Saleh127

Cf 1392A

Aug 16th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. ios_base::sync_with_stdio(0);
  6. cin.tie(0);cout.tie(0);
  7.  
  8. int t;
  9. cin>>t;
  10. while(t--)
  11. {
  12. long long a[200005],c,d,e=0,f=0,i,j,k,l;
  13. cin>>c;
  14. for(i=0;i<c;i++)
  15. {
  16. cin>>a[i];
  17. }
  18. d=1;
  19. sort(a,a+c);
  20. for(i=0;i<c-1;i++)
  21. {
  22. if(a[i]==a[i+1])d++;
  23. }
  24. if(d==c) cout<<c<<endl;
  25. else cout<<1<<endl;
  26. }
  27.  
  28.  
  29. return 0;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement