#include <iostream>
#include <vector>
#include <queue>
using namespace std;
void output_vector(vector<int> vec, bool isEnterSeperated) {
for (size_t i = 0; i < vec.size(); i++)
{
cout << vec[i];
if (isEnterSeperated) {
cout << "\n";
}
else {
cout << " ";
}
}
}
int main()
{
int n;
cin >> n;
vector<int> res(n,-1);
vector<int> inp(n);
vector<bool> app(2*n);
int old = -1;
for (size_t i = 0; i < n; i++)
{
cin >> inp[i];
if (inp[i] > i + 1) {
cout << "NEM";
return 0;
}
app[inp[i]] = true;
if (inp[i] != old) {
res[i] = old;
}
old = inp[i];
}
int l = 0;
for (size_t i = 0; i < res.size(); i++)
{
if (res[i] == -1) {
for (size_t j = l; j < app.size(); j++)
{
if (!app[j]) {
l = j;
break;
}
}
res[i] = l;
l++;
}
}
cout << "IGEN\n";
output_vector(res, false);
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1808 KiB | ||||
2 | Accepted | 3ms | 2212 KiB | ||||
subtask2 | 0/8 | ||||||
3 | Accepted | 3ms | 2280 KiB | ||||
4 | Accepted | 3ms | 2528 KiB | ||||
5 | Accepted | 3ms | 2732 KiB | ||||
6 | Accepted | 3ms | 2956 KiB | ||||
7 | Accepted | 3ms | 3152 KiB | ||||
8 | Accepted | 3ms | 3344 KiB | ||||
9 | Accepted | 3ms | 3584 KiB | ||||
10 | Accepted | 3ms | 3792 KiB | ||||
11 | Wrong answer | 2ms | 3816 KiB | ||||
subtask3 | 0/16 | ||||||
12 | Accepted | 3ms | 3792 KiB | ||||
13 | Accepted | 3ms | 3796 KiB | ||||
14 | Accepted | 3ms | 3908 KiB | ||||
15 | Accepted | 3ms | 3916 KiB | ||||
16 | Wrong answer | 3ms | 3916 KiB | ||||
subtask4 | 0/32 | ||||||
17 | Accepted | 6ms | 3940 KiB | ||||
18 | Accepted | 6ms | 3940 KiB | ||||
19 | Accepted | 6ms | 4196 KiB | ||||
20 | Accepted | 6ms | 4148 KiB | ||||
21 | Accepted | 6ms | 4444 KiB | ||||
22 | Accepted | 6ms | 4404 KiB | ||||
23 | Accepted | 4ms | 4336 KiB | ||||
24 | Wrong answer | 4ms | 4364 KiB | ||||
subtask5 | 0/44 | ||||||
25 | Accepted | 246ms | 16164 KiB | ||||
26 | Accepted | 245ms | 16200 KiB | ||||
27 | Accepted | 245ms | 16164 KiB | ||||
28 | Accepted | 245ms | 16164 KiB | ||||
29 | Accepted | 245ms | 16164 KiB | ||||
30 | Accepted | 246ms | 16160 KiB | ||||
31 | Accepted | 246ms | 16400 KiB | ||||
32 | Accepted | 246ms | 16376 KiB | ||||
33 | Accepted | 246ms | 16408 KiB | ||||
34 | Accepted | 248ms | 16768 KiB | ||||
35 | Accepted | 248ms | 16692 KiB | ||||
36 | Accepted | 141ms | 12520 KiB | ||||
37 | Wrong answer | 244ms | 16752 KiB |