Advertisement
Saleh127

CF 1400A

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