QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#196179#6965. Equalize the Arrayyiyiyi#WA 42ms13620kbC++141.0kb2023-10-01 13:48:102023-10-01 13:48:11

Judging History

你现在查看的是最新测评结果

  • [2023-10-01 13:48:11]
  • 评测
  • 测评结果:WA
  • 用时:42ms
  • 内存:13620kb
  • [2023-10-01 13:48:10]
  • 提交

answer

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<map>
#include<queue>
#include<bitset>
#include<set>
#define int long long
#define lowbit(x) x&(-x)
#define mp make_pair
#define rep(i,x,n) for(int i=x;i<=n;i++)
#define per(i,n,x) for(int i=n;i>=x;i--)
#define forE(i,x) for(int i=head[x];i;i=nxt[i])
#define pii pair<int,int>
#define fi first
#define se second
using namespace std;
const int maxn=2e6+5;
const int maxm=2e6+5;
const int mod=998244353;
inline int read()
{
	int x=0,f=1;char c=getchar();
	while(c<'0'||c>'9')
	{
		if(c=='-') f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9')
	{
		x=x*10+(c-'0');
		c=getchar();
	}
	return x*f;
}

int a[maxn],cnt[maxn];
signed main()
{
	int T=read();
	while(T--)
	{
		int n=read();
		rep(i,1,n) a[i]=read();
		sort(a+1,a+n+1);
		int mx=0;
		rep(i,1,n) cnt[a[i]]++,mx=max(mx,cnt[a[i]]);
		if(cnt[a[1]]==mx) puts("YES");
		else puts("NO");
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 42ms
memory: 13620kb

input:

105
500000
33226 432708 432708 432708 280629 33226 370163 182525 33226 33226 432708 432708 33226 33226 432708 432708 33226 33226 432708 33226 124133 432708 432708 33226 432708 33226 432708 33226 33226 33226 432708 432708 33226 432708 173002 432708 33226 33226 432708 33226 33226 33226 432708 432708 7...

output:

NO
NO
NO
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
YES
YES
NO
NO
NO
YES
NO
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES...

result:

wrong answer 12th lines differ - expected: 'YES', found: 'NO'