Submission #861846

#TimeUsernameProblemLanguageResultExecution timeMemory
861846maks007Zalmoxis (BOI18_zalmoxis)C++14
0 / 100
92 ms8124 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; } for(auto i : a) { cout << i << " "; if(i == cnt + 1) cout << cnt << " "; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...