Find majority elements

#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
ll n;
cin>>n;
int k=floor(n/3);
map<int,int>f;
ll a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++)
{
f[a[i]]++;
}
if(f.size()==0)
{
cout<<“No Majority Elements”;
}
else
{
for(auto t : f)
{
if(t.second>k)
{
cout<<t.first<<" ";
}
}
}
}
what’s wrong in this code…why it is not passing all the test cases

@surbhidabhade condition for No majority element is when you don’t find any element appearing more than floor[n/3] but that does not mean you f.size() will be null in that case.
change case when to print No majority element.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.