Advertisement
Saleh127

CF 1149A

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