L - Ray in the tube Gym——东二(??)
作者:互联网
#include<bits/stdc++.h>
using namespace std;
const int M=1e5+5;
int up[M],down[M],ans=2,n,m;
map<int,int>mp;
int main()
{
scanf("%d%*d",&n);
for(int i=1;i<=n;++i)
scanf("%d",&up[i]);
scanf("%d%*d",&m);
for(int i=1;i<=m;++i)
scanf("%d",&down[i]);
for(int d=2;d<=1e9;d<<=1)
{
mp.clear();
for(int i=1;i<=n;++i){
++mp[up[i]%d];
ans=max(ans,mp[up[i]%d]);
}
for(int i=1;i<=m;++i){
++mp[(down[i]+(d>>1))%d];
ans=max(ans,mp[(down[i]+(d>>1))%d]);
}
}
printf("%d",ans);
}
不懂,先贴出来
标签:int,Gym,printf,down,1e5,ans,东二,tube 来源: https://blog.csdn.net/weixin_43890047/article/details/89052661