Submission #861847

#TimeUsernameProblemLanguageResultExecution timeMemory
861847maks007Zalmoxis (BOI18_zalmoxis)C++14
0 / 100
111 ms8304 KiB
#include "bits/stdc++.h" using namespace std; signed main () { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, k, cnt = 0; cin >> n >> k; vector <int> a; for(int i = 0; i < n; i ++) { int x; cin >> x; a.push_back(x); cnt += (1 << x); } int need = (1 << 30) - cnt; cnt = 0; while(need > 1) { cnt ++; need /= 2; } int f = -1; for(auto i : a) { cout << i << " "; if(i == cnt + 1 && f == -1) { f = 1; cout << cnt << " "; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...