Submission details
Task:Lista
Sender:MojoLake
Submission time:2025-11-09 09:21:01 +0200
Language:C++ (C++20)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.00 sdetails
#20.00 sdetails
#30.00 sdetails
#40.00 sdetails
#50.00 sdetails

Code

#include <bits/stdc++.h>

#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()

using namespace std;
using ll = long long;

const int inf = 1e9;
const ll LLInf = 1e18;

int main() {
    cin.tie(0)->sync_with_stdio(0);
    int n, m;
    cin >> n >> m;

    vector<pair<int, int>> a(n);
    for (int i = 1; i <= n; ++i) {
        a[i - 1] = {0, i};
    }

    while (m--) {
        int x; cin >> x;
        a[x - 1].first++;
    }

    sort(rbegin(a), rend(a));
    for (auto [_, x] : a) cout << x << " ";
    cout << "\n";
}

Test details

Test 1

Verdict:

input
1 1
1

correct output
1

user output

Test 2

Verdict:

input
100 1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

correct output
1000
1 100 99 98 97 96 95 94 93 92 ...

user output
1 100 99 98 97 96 95 94 93 92 ...

Test 3

Verdict:

input
100 1000
1 2 2 2 1 1 1 1 1 1 1 1 1 2 1 ...

correct output
1488
1 2 100 99 98 97 96 95 94 93 9...

user output
1 2 100 99 98 97 96 95 94 93 9...

Test 4

Verdict:

input
100 1000
7 8 2 4 8 3 3 10 9 7 7 6 8 7 2...

correct output
5109
3 8 7 5 1 6 2 4 9 10 100 99 98...

user output
3 8 7 5 1 6 2 4 9 10 100 99 98...

Test 5

Verdict:

input
100 1000
23 85 3 99 63 79 38 37 67 28 7...

correct output
41714
57 38 63 62 93 85 95 81 79 61 ...

user output
57 38 63 62 93 85 95 81 79 61 ...