Submission #843173

#TimeUsernameProblemLanguageResultExecution timeMemory
843173Elvin_FritlZalmoxis (BOI18_zalmoxis)C++17
0 / 100
1010 ms262144 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 66; int n, k, v[N], ind = 0; vector<int> res; void func(int x){ if(ind > x || 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=0;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...