#include<bits/stdc++.h>
using namespace std;
long long a[200007];
vector<int>v[77];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
for(int i=1;i<=n;++i){
cin>>a[i];
long long tmp=a[i];
int cnt=0;
while(!(tmp&1)){
tmp/=2;
++cnt;//二进制上最后一位1的位置
}
v[cnt].push_back(i);
}
int mx=v[0].size();
int pos=0;
for(int i=1;i<=64;++i)
if(v[i].size()>mx){
mx=v[i].size();
pos=i;
}
cout<<n-mx<<"\n";
for(int i=0;i<=64;++i){
if(i==pos)
continue;
for(int j=0;j<v[i].size();++j)
cout<<a[v[i][j]]<<" ";
}
return 0;
}

Codeforces Round #586 (Div. 1 + Div. 2)D(二分图构建,思维,结论需数论证明)的更多相关文章

  1. Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...

  2. Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...

  3. Educational Codeforces Round 43 (Rated for Div. 2)

    Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...

  4. Educational Codeforces Round 35 (Rated for Div. 2)

    Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...

  5. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://cod ...

  6. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://code ...

  7. Educational Codeforces Round 63 (Rated for Div. 2) 题解

    Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进 ...

  8. Educational Codeforces Round 39 (Rated for Div. 2) G

    Educational Codeforces Round 39 (Rated for Div. 2) G 题意: 给一个序列\(a_i(1 <= a_i <= 10^{9}),2 < ...

  9. Educational Codeforces Round 48 (Rated for Div. 2) CD题解

    Educational Codeforces Round 48 (Rated for Div. 2) C. Vasya And The Mushrooms 题目链接:https://codeforce ...

随机推荐

  1. Linux运维工作总结教训

    Linux运维一定要知道的六类好习惯和23个教训,避免入坑!从事运维三年半,遇到过各式各样的问题,数据丢失,网站挂马,误删数据库文件,黑客攻击等各类问题. 今天简单整理一下,分享给各位小伙伴. 一.线 ...

  2. unittest 测试套件使用汇总篇

    # coding=utf-8import unittestfrom inspect import isfunction def usage(): """also unit ...

  3. C#: switch语句的重构『网摘』

    http://bj007.blog.51cto.com/1701577/345100/ switch语句是我们日常工作中最常见也是争论最多的(goto被忽视的前提下).在重构中也把switch语句看成 ...

  4. 结构体数组排序:1004 成绩排名 【pta】

    结构体模板 struct STU { string name; //用string可以代替char string num; int s; }; sort是用快速排序实现的,属于不稳定排序,stable ...

  5. Linux03——磁盘分区和挂载

    Windows下的磁盘分区: 常用的两种磁盘分区类型 mbr: 操作系统安装在主分区 只支持4个主分区 拓展分区占一个主分区 gpt(win7 64位之后) 无限主分区 支持超大硬盘3T以上 查看所有 ...

  6. BZOJ-1563-郁闷的出纳员(权值线段树)

    偏移量要考虑清楚. #include <bits/stdc++.h> using namespace std; const int N=4e5+10; const int BASE=1e5 ...

  7. springMVC的概念

    1,完成一次web请求的过程 Web浏览器发起请求 Web服务器接收请求并处理请求,最后产生响应(一般为html).web服务器处理完成后,返回内容给web客户端,客户端对接收的内容进行处理并显示出来 ...

  8. [C/C++] 静态变量赋值问题 undefined reference to

    刚才在写代码的时候 用到了一个静态变量 然后在别人地方直接使用的时候 也就是 NetWork::Flag = 0; 像是这样使用的时候一直提示 undefined reference to 各种检查之 ...

  9. 部署etcd中使用ansible进行变量初始化

    ansible-playbook 要进行默认变量的生产,可以依靠jinja 的模板渲染功能 看几个官方给出的例子 调用setup 中的变量 例如 setup 中的变量层级为 ansible_eth0_ ...

  10. finally语句块一定会被执行吗

    finally语句块一定会被执行吗? 答案: 不一定 1. 发生异常的代码必须在try 代码块中,才有可能被执行 public class MyTest { public static void ma ...