Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define fastio ios_base::sync_with_stdio(false); cin.tie(0);
- #define pb(a) push_back(a)
- #define mp(a, b) make_pair(a, b)
- #define all(a) a.begin(), a.end()
- typedef long long ll;
- const ll LINF = 1e16 + 239;
- const int INF = 1e9 + 239;
- const ll MAXN = 1e6 + 239;
- const int MOD = 998244353;
- ll boof1, boof2, boof;
- using namespace std;
- void solve()
- {
- }
- int pw (ll a)
- {
- if (a % 2 == 1)
- return 0;
- else
- return pw(a / 2) + 1;
- }
- vector <int> p;
- int main()
- {
- //fastio
- int n;
- p.resize(64);
- cin >> n;
- ll w[n]; ll gcd = 0;
- vector <ll> ans;
- int o = 0, e = 0;
- for (int i = 0; i < n; i++)
- {
- cin >> w[i];
- p[pw(w[i])]++;
- }
- int mxp = -1, mxn = -1;
- for (int i = 0; i < 64; i++)
- {
- if (p[i] > mxn)
- {
- mxn = p[i];
- mxp = i;
- }
- }
- cout << n - mxn << endl;
- for (int i = 0; i < n; i++)
- {
- if (pw(w[i]) != mxp)
- {
- cout << w[i] << " ";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement