QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#279486#6965. Equalize the ArrayIsaacMoris#AC ✓134ms6592kbC++14696b2023-12-08 19:57:542023-12-08 19:57:55

Judging History

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

  • [2023-12-08 19:57:55]
  • 评测
  • 测评结果:AC
  • 用时:134ms
  • 内存:6592kb
  • [2023-12-08 19:57:54]
  • 提交

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();
    }
}

詳細信息

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