This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |