Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define fastio ios_base::sync_with_stdio(false); cin.tie(0);
  3. #define pb(a) push_back(a)
  4. #define mp(a, b) make_pair(a, b)
  5. #define all(a) a.begin(), a.end()
  6.  
  7. typedef long long ll;
  8. const ll LINF = 1e16 + 239;
  9. const int INF = 1e9 + 239;
  10. const ll MAXN = 1e6 + 239;
  11. const int MOD = 998244353;
  12. ll boof1, boof2, boof;
  13. using namespace std;
  14.  
  15. void solve()
  16. {
  17.  
  18. }
  19.  
  20. int pw (ll a)
  21. {
  22.     if (a % 2 == 1)
  23.         return 0;
  24.     else
  25.         return pw(a / 2) + 1;
  26. }
  27.  
  28. vector <int> p;
  29.  
  30. int main()
  31. {
  32.     //fastio
  33.     int n;
  34.     p.resize(64);
  35.     cin >> n;
  36.     ll w[n]; ll gcd = 0;
  37.     vector <ll> ans;
  38.     int o = 0, e = 0;
  39.     for (int i = 0; i < n; i++)
  40.     {
  41.         cin >> w[i];
  42.         p[pw(w[i])]++;
  43.     }
  44.     int mxp = -1, mxn = -1;
  45.     for (int i = 0; i < 64; i++)
  46.     {
  47.         if (p[i] > mxn)
  48.         {
  49.             mxn = p[i];
  50.             mxp = i;
  51.         }
  52.     }
  53.     cout << n - mxn << endl;
  54.     for (int i = 0; i < n; i++)
  55.     {
  56.         if (pw(w[i]) != mxp)
  57.         {
  58.             cout << w[i] << " ";
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement