이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |