Problem A: GJJ的日常之再遊戲
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 819 Solved: 167
SubmitWeb Board
Description
Input
Output
Sample Input
Sample Output
HINT
#include<cstdio>
#include<algorithm>
using namespace std;
#define Max 50005
int a[Max];
int main()
{
int N,num,temp,mmax;
while(scanf("%d",&N)!=EOF)
{
mmax=0;
for(int i=0;i<N;i++)
{
scanf("%d",&a[i]);
}
sort(a,a+N);
temp=a[0];
for(int i=1;i<N;i++)
{
if(a[i]>temp)
{
temp=a[i];
mmax++;
}
}
if(mmax+1>N/2) printf("Yes\n");
else printf("No\n");
}
return 0;
}