104792024-04-03 11:14:50csaron71Mexxcpp17Wrong answer 0/100263ms17908 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> szamok;
    vector<int> valt;
    bool vege=false;
    for (int i=0; i<n; i++) {
        int x;
        cin >> x;
        szamok.push_back(x);
        if (szamok[i]>i+1) {
            vege=true;
        }
    }
    if (vege==true) {
        cout << "NEM\n";
        return 0;
    }
    for (int i=1; i<n; i++) {
        if (szamok[i]<szamok[i-1]) {
            cout << "NEM\n";
            return 0;
        }
        if (szamok[i]>szamok[i-1]) {
            valt.push_back(szamok[i]);
        }
    }

    int epp=0;
    vector<int> veg;
    int y=0;
    if (szamok[0]==0) {
        epp++;
        while (epp==valt[y]) {
            epp++;
            y++;
        }
        veg.push_back(epp);
    }
    for (int i=1; i<n; i++) {
        if (szamok[i]>szamok[i-1]) {
             veg.push_back(szamok[i-1]);
        }
        else {
            epp++;
            while (epp==valt[y]) {
                epp++;
                y++;
            }
            veg.push_back(epp);
        }
    }
    cout << "IGEN\n";
    for (int sz : veg) {
        cout << sz << " ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1808 KiB
2Wrong answer3ms2060 KiB
subtask20/8
3Runtime error3ms2120 KiB
4Accepted3ms2084 KiB
5Wrong answer3ms2088 KiB
6Accepted3ms2116 KiB
7Accepted3ms2328 KiB
8Runtime error3ms2680 KiB
9Accepted3ms2724 KiB
10Partially correct3ms2968 KiB
11Accepted3ms3000 KiB
subtask30/16
12Wrong answer3ms2968 KiB
13Wrong answer3ms3220 KiB
14Wrong answer3ms3464 KiB
15Accepted3ms3592 KiB
16Accepted3ms3460 KiB
subtask40/32
17Wrong answer6ms3824 KiB
18Wrong answer6ms4060 KiB
19Wrong answer6ms3928 KiB
20Wrong answer6ms4184 KiB
21Wrong answer6ms4192 KiB
22Wrong answer6ms4196 KiB
23Accepted4ms4152 KiB
24Accepted4ms4212 KiB
subtask50/44
25Accepted261ms13884 KiB
26Wrong answer259ms14140 KiB
27Wrong answer263ms13984 KiB
28Wrong answer261ms13968 KiB
29Wrong answer261ms16308 KiB
30Wrong answer259ms16360 KiB
31Wrong answer263ms16392 KiB
32Wrong answer259ms16620 KiB
33Wrong answer263ms16700 KiB
34Wrong answer261ms17220 KiB
35Wrong answer263ms17908 KiB
36Accepted189ms9108 KiB
37Accepted192ms9236 KiB