#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. Spring JdbcTemplate类常用的方法

    execute(String  sql) 可执行任何sql语句,但返回值是void,所以一般用于数据库的新建.修改.删除和数据表记录的增删改. int  update(String sql) int  ...

  2. 「JSOI2015」地铁线路

    「JSOI2015」地铁线路 传送门 第一问很简单:对于每条线路建一个点,然后所有该条线路覆盖的点向它连边,权值为 \(1\) ,然后它向所有线路上的点连边,权值为 \(0\) . 然后,跑一边最短路 ...

  3. js实现上移下移

    直接上代码 //上移 var $up = $(".up") $up.click(function () { var $tr = $(this).parents("tr&q ...

  4. python-线程池的两种实现方式 【转载】

    #!/usr/bin/env python # -*- coding:utf-8 -*- import queue import threading import contextlib import ...

  5. Django框架之ORM的相关操作(二)

    模型类: class Commongity(models.Model): id=models.AutoField(primary_key=True) name=models.CharField(max ...

  6. 安卓开发:打印Log

    在iOS开发中使用NSLog进行打印调试,在安卓中使用的是Log.v(tag, msg);等进行打印调试. 参考:[https://blog.csdn.net/salary/article/detai ...

  7. JSON parse error: default constructor not found. class java.time.YearMonth; nested exception is com.alibaba.fastjson.JSONException: default constructor not found. class java.time.YearMonth

    java8新出的YearMonth可以方便的用来表示某个月.我的项目中使用springmvc来接收YearMonth类型的数据时发现 x-www-from-urlencoded 格式的数据可以使用&q ...

  8. jQuery中$.fn

    $.fn是指jquery的命名空间,加上fn上的方法及属性,会对jquery实例每一个有效. 如扩展$.fn.abc(),即$.fn.abc()是对jquery扩展了一个abc方法,那么后面你的每一个 ...

  9. jquery Ajax标准规范写法

    $.ajax({ url:"http://www.xxx",//请求的url地址 dataType:"json",//返回的格式为json async:true ...

  10. accordion(折叠面板)的使用

    一.前言: 折叠面板(accordion)允许使用多面板(panel),同时显示一个或多个面板(panel).每个面板(panel)都有展开和折叠的内建支持.点击面板(panel)头部可展开或折叠面板 ...