QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#279486 | #6965. Equalize the Array | IsaacMoris# | AC ✓ | 134ms | 6592kb | C++14 | 696b | 2023-12-08 19:57:54 | 2023-12-08 19:57:55 |
Judging History
answer
#include<iostream>
#include <bits/stdc++.h>
#define ld long double
#define ll long long
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int N = 30, mod = 998244353;
void doWork() {
int n;
cin >> n;
int mx = 0;
map<int, int> freq;
while (n--) {
int x;
cin >> x;
freq[x]++;
mx = max(mx, freq[x]);
}
if (freq.begin()->second != mx) {
cout << "NO\n";
} else {
cout << "YES\n";
}
}
int main() {
IO
int t = 1;
cin >> t;
for (int i = 1; i <= t; i++) {
// cout << "Case #" << i << ": ";
doWork();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 134ms
memory: 6592kb
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 YES NO YES YES NO YES YES NO NO NO YES NO YES YES YES YES NO NO NO NO NO NO YES YES YES NO NO YES NO NO NO NO NO YES YES NO YES NO NO YES YES NO YES NO NO NO NO NO NO YES YES YES NO NO YES NO YES NO NO NO NO YES NO NO NO YES NO NO YES NO NO NO NO NO YES NO YES YES...
result:
ok 105 lines