Codeforces Round #586 (Div. 1 + Div. 2)D(二分图构建,思维,结论需数论证明)
#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(二分图构建,思维,结论需数论证明)的更多相关文章
- 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 ...
- 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 ...
- Educational Codeforces Round 43 (Rated for Div. 2)
Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...
- Educational Codeforces Round 35 (Rated for Div. 2)
Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...
- 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 ...
- 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 ...
- Educational Codeforces Round 63 (Rated for Div. 2) 题解
Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进 ...
- 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 < ...
- Educational Codeforces Round 48 (Rated for Div. 2) CD题解
Educational Codeforces Round 48 (Rated for Div. 2) C. Vasya And The Mushrooms 题目链接:https://codeforce ...
随机推荐
- Plastic Bottle Manufacturer Profile: Plastic Bottle Forming Process
Plastic bottle molding refers to the process of making a final plastic product from a polymer produc ...
- ajax传map,后端接收并解析
前端let map = new Map(); map.set(1, 1); map.set(2, 2); map.set(3, 3); //map转obj let obj= Object.create ...
- source insight 编译后出现停止工作解决方法
解决方法: 工程的路径不要有中文,都用英文
- js克隆一个对象
我们知道,对象类型在赋值的过程中其实是复制了地址,所以如果改变了一方,其他都会被改变.我们应该如何克隆一个对象,并且避免这种现象的发生呢? 方法一:Object.assign function cop ...
- 1、TensorFlow如何工作?
TensorFlow特殊的张量计算引擎使得TensorFlow能够很好的满足机器学习的计算需要,从2015年开始发起 本书基于TensorFlow0.12+和python3.0+ 环境安装要求 pip ...
- 微信小程序获取unionid
链接:https://blog.csdn.net/a493001894/article/details/80323403
- Java入门笔记 08-注解
1. 注解:通过 @interface 关键字进行定义2. 元注解:是一种基本注解,但是它能够应用到其它的注解上面.@Retention:解释说明了这个注解的的存活时间.取值如下: Retention ...
- JS--easyui通用验证
// JavaScript Document $.extend($.fn.validatebox.defaults.rules, { Composite_validation: { validator ...
- Python NumPy中数组array.min(0)返回数组
如果没有参数min()返回一个标量,如果有参数0表示沿着列,1表示沿着行.
- 【代码学习】PYTHON 函数
一.定义函数 def 函数名(): 代码 二.函数调用 #定义函数 def printme(str): print str return #调用函数 printme("SQYY1" ...