A
# include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL MAXN=1e5+10;
LL a[MAXN];
LL b[MAXN];
int main()
{
LL n,m;
LL ao=0,ae=0,bo=0,be=0;
LL sum=0;
scanf("%lld %lld",&n,&m);
for(LL i=0;i<n;i++){
scanf("%lld",&a[i]);
if(a[i]%2==0){
ae++;
}else{
ao++;
}
}
for(LL i=0;i<m;i++){
scanf("%lld",&b[i]);
if(b[i]%2==0){
be++;
}else{
bo++;
}
}
sum=min(ae,bo)+min(ao,be);
printf("%lld",sum);
return 0;
}
B
# include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL n[40];
LL l[40];
int lenn(LL xx)
{
int flag=0;
int len=0;
while(xx){
int d=xx%2;
if(d){
if(flag) break;
len++;
}else{
flag=1;
len++;
}
xx=xx/2;
}
return len;
}
int main()
{
LL x;
LL t=1;
scanf("%lld",&x);
LL xx=x;
LL ans=0;
int fflag=1;
while(xx){
int d=xx%2;
if(d==0){
fflag=0;
}
xx=xx/2;
ans++;
}
if(fflag){
printf("0");
return 0;
}
ans=pow(2,ans)-1;