Submission details
Task:Lista
Sender:sharph2
Submission time:2025-11-07 22:21:54 +0200
Language:C++ (C++17)
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 <algorithm>
#include <iostream>
#include <vector>

using namespace std;

using Z = long long int;

int main() {
    Z n, m;
    cin >> n >> m;

    vector<pair<Z, Z>> lkm(n);
    for(Z i = 0; i < n; ++i) {
        lkm[i].second = i;
    }
    for(Z i = 0; i < m; ++i) {
        Z haku;
        cin >> haku;
        --haku;
        ++lkm[haku].first;
    }
    sort(lkm.rbegin(), lkm.rend());

    for(auto [montax, haku] : lkm) {
        cout << haku + 1 << " ";
    }
    cout << "\n";

    return 0;
}

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 ...