Submission #843175

#TimeUsernameProblemLanguageResultExecution timeMemory
843175Elvin_FritlZalmoxis (BOI18_zalmoxis)C++17
0 / 100
112 ms4204 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...