#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define inf 1e18
const int mod=1e9+7;
const int N=2e5+5;
int n,m,cnt[N];
map<int,int>mp;
void solve(){
cin>>n;
for(int i=1,x;i<=n;i++){
cin>>x;
mp[x]++;
}
cin>>m;
int ans;
if(mp.count(m)) ans=mp[m];
else ans=0;
for(auto it:mp){
int x=it.first,y=it.second;
int t=0;
while(x>m){
t++;
x=(int)ceil(x/3.0);
y*=2;
if(x==m) cnt[t]+=y;
}
}
cout<<max(ans,*max_element(cnt,cnt+100));
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int tt=1;
// cin>>tt;
while(tt--) solve();
return 0;
}
耕种时间到!(枚举)--牛客小白月赛92-C
最新推荐文章于 2024-07-25 11:35:59 发布