#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 66;
int n, k, v[N], ind = 1;
vector<int> res;
void func(int x){
if(ind > n || v[ind] > x)
{
res.push_back(x);
return;
}
if(v[ind] == x)
{
ind++;
res.push_back(x);
return;
}
func(x - 1);
func(x - 1);
}
int32_t main()
{
int n,k;
cin>>n>>k;
for(int i=1;i<=n;i++){
cin>>v[i];
}
func(30);
for(auto &i:res){
cout<<i<<" ";
}
}
/*
1 1 2 2 3 3 4 4
1
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
108 ms |
4204 KB |
Unexpected end of file - int32 expected |
2 |
Incorrect |
106 ms |
4200 KB |
Unexpected end of file - int32 expected |
3 |
Incorrect |
108 ms |
4188 KB |
Unexpected end of file - int32 expected |
4 |
Incorrect |
101 ms |
4188 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
103 ms |
4184 KB |
Unexpected end of file - int32 expected |
6 |
Incorrect |
101 ms |
4196 KB |
Unexpected end of file - int32 expected |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
112 ms |
4184 KB |
Unexpected end of file - int32 expected |
2 |
Incorrect |
102 ms |
4184 KB |
Unexpected end of file - int32 expected |
3 |
Incorrect |
101 ms |
4180 KB |
Unexpected end of file - int32 expected |
4 |
Incorrect |
101 ms |
4176 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
101 ms |
4180 KB |
Unexpected end of file - int32 expected |
6 |
Incorrect |
107 ms |
4180 KB |
Unexpected end of file - int32 expected |
7 |
Incorrect |
102 ms |
4184 KB |
Unexpected end of file - int32 expected |
8 |
Incorrect |
101 ms |
4176 KB |
Unexpected end of file - int32 expected |
9 |
Incorrect |
81 ms |
3420 KB |
Unexpected end of file - int32 expected |
10 |
Incorrect |
31 ms |
2648 KB |
Unexpected end of file - int32 expected |
11 |
Incorrect |
50 ms |
2648 KB |
Unexpected end of file - int32 expected |
12 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int32 expected |
13 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int32 expected |
14 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int32 expected |