#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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1808 KiB | ||||
2 | Wrong answer | 3ms | 2060 KiB | ||||
subtask2 | 0/8 | ||||||
3 | Runtime error | 3ms | 2120 KiB | ||||
4 | Accepted | 3ms | 2084 KiB | ||||
5 | Wrong answer | 3ms | 2088 KiB | ||||
6 | Accepted | 3ms | 2116 KiB | ||||
7 | Accepted | 3ms | 2328 KiB | ||||
8 | Runtime error | 3ms | 2680 KiB | ||||
9 | Accepted | 3ms | 2724 KiB | ||||
10 | Partially correct | 3ms | 2968 KiB | ||||
11 | Accepted | 3ms | 3000 KiB | ||||
subtask3 | 0/16 | ||||||
12 | Wrong answer | 3ms | 2968 KiB | ||||
13 | Wrong answer | 3ms | 3220 KiB | ||||
14 | Wrong answer | 3ms | 3464 KiB | ||||
15 | Accepted | 3ms | 3592 KiB | ||||
16 | Accepted | 3ms | 3460 KiB | ||||
subtask4 | 0/32 | ||||||
17 | Wrong answer | 6ms | 3824 KiB | ||||
18 | Wrong answer | 6ms | 4060 KiB | ||||
19 | Wrong answer | 6ms | 3928 KiB | ||||
20 | Wrong answer | 6ms | 4184 KiB | ||||
21 | Wrong answer | 6ms | 4192 KiB | ||||
22 | Wrong answer | 6ms | 4196 KiB | ||||
23 | Accepted | 4ms | 4152 KiB | ||||
24 | Accepted | 4ms | 4212 KiB | ||||
subtask5 | 0/44 | ||||||
25 | Accepted | 261ms | 13884 KiB | ||||
26 | Wrong answer | 259ms | 14140 KiB | ||||
27 | Wrong answer | 263ms | 13984 KiB | ||||
28 | Wrong answer | 261ms | 13968 KiB | ||||
29 | Wrong answer | 261ms | 16308 KiB | ||||
30 | Wrong answer | 259ms | 16360 KiB | ||||
31 | Wrong answer | 263ms | 16392 KiB | ||||
32 | Wrong answer | 259ms | 16620 KiB | ||||
33 | Wrong answer | 263ms | 16700 KiB | ||||
34 | Wrong answer | 261ms | 17220 KiB | ||||
35 | Wrong answer | 263ms | 17908 KiB | ||||
36 | Accepted | 189ms | 9108 KiB | ||||
37 | Accepted | 192ms | 9236 KiB |