Nusrat_Ullah

CF 572 A

Jul 5th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     int t,g,re;
  6.     size_t o,z;
  7.     string q,ns1,ns2;
  8.     scanf("%d",&t);
  9.     cin>>q;
  10.     o=count(q.begin(),q.end(),'1');
  11.     z=t-o;
  12.     if(z!=o)re=1,ns1=q;
  13.     else{
  14.         re=2;
  15.         ns1=q[0];
  16.         ns2=q.substr(1);
  17.     }
  18.     if(re==1){
  19.         printf("%d\n",re);
  20.         cout<<ns1<<endl;
  21.     }
  22.     else{
  23.         printf("%d\n",re);
  24.         cout<<ns1<<" "<<ns2<<endl;
  25.     }
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment