10611 | 2024-04-06 14:51:49 | Ablablabla | Mexx | cpp17 | Wrong answer 0/100 | 270ms | 17476 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> szamok(n);
for(int i = 0; i < n; i++){
cin >> szamok[i];
}
for(int i = 0; i < n; i++){
if(szamok[i] > i + 1){
cout << "NEM\n";
return 0;
}
}
cout << "IGEN\n";
vector<bool> foglalt(2 * n + 1, 0);
if(szamok[0] != 0) foglalt[0] = 1;
for(int i = 1; i < n; i++){
if(szamok[i - 1] != szamok[i]){
foglalt[szamok[i - 1]] = 1;
}
}
foglalt[szamok[n - 1]] = 1;
vector<int> szabad;
for(int i = 0; i <= 2 * n; i++){
if(!foglalt[i]){
szabad.push_back(i);
}
}
int ind = 0;
if(szamok[0] == 0){
cout << szabad[ind] << " ";
ind++;
} else{
cout << "0 ";
}
for(int i = 1; i < n; i++){
if(szamok[i - 1] != szamok[i]){
cout << szamok[i - 1] << " ";
} else{
cout << szabad[ind] << " ";
ind++;
}
}
cout << "\n";
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1996 KiB | ||||
2 | Accepted | 3ms | 2224 KiB | ||||
subtask2 | 0/8 | ||||||
3 | Accepted | 3ms | 2460 KiB | ||||
4 | Accepted | 3ms | 2476 KiB | ||||
5 | Accepted | 3ms | 2588 KiB | ||||
6 | Accepted | 3ms | 2716 KiB | ||||
7 | Accepted | 3ms | 2808 KiB | ||||
8 | Accepted | 3ms | 2932 KiB | ||||
9 | Accepted | 3ms | 3164 KiB | ||||
10 | Accepted | 3ms | 3244 KiB | ||||
11 | Wrong answer | 3ms | 3352 KiB | ||||
subtask3 | 0/16 | ||||||
12 | Accepted | 3ms | 3596 KiB | ||||
13 | Accepted | 3ms | 3724 KiB | ||||
14 | Accepted | 3ms | 3940 KiB | ||||
15 | Accepted | 3ms | 3948 KiB | ||||
16 | Wrong answer | 3ms | 3940 KiB | ||||
subtask4 | 0/32 | ||||||
17 | Accepted | 6ms | 4348 KiB | ||||
18 | Accepted | 6ms | 4440 KiB | ||||
19 | Accepted | 6ms | 4544 KiB | ||||
20 | Accepted | 6ms | 4568 KiB | ||||
21 | Accepted | 6ms | 4668 KiB | ||||
22 | Accepted | 6ms | 4644 KiB | ||||
23 | Accepted | 4ms | 4396 KiB | ||||
24 | Wrong answer | 6ms | 4652 KiB | ||||
subtask5 | 0/44 | ||||||
25 | Accepted | 264ms | 16728 KiB | ||||
26 | Accepted | 266ms | 16840 KiB | ||||
27 | Accepted | 266ms | 16728 KiB | ||||
28 | Accepted | 264ms | 17012 KiB | ||||
29 | Accepted | 270ms | 17220 KiB | ||||
30 | Accepted | 263ms | 17016 KiB | ||||
31 | Accepted | 266ms | 17016 KiB | ||||
32 | Accepted | 268ms | 17304 KiB | ||||
33 | Accepted | 266ms | 17216 KiB | ||||
34 | Accepted | 268ms | 17476 KiB | ||||
35 | Accepted | 268ms | 17404 KiB | ||||
36 | Accepted | 187ms | 8756 KiB | ||||
37 | Wrong answer | 266ms | 17340 KiB |