# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
969578 | dubabuba | Permutation (APIO22_perm) | C++17 | 2 ms | 500 KiB |
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>
#include "perm.h"
using namespace std;
typedef long long i64;
typedef vector<int> vi;
const int mxLOG = 62;
vi construct_permutation(i64 K) {
i64 k = K - 1;
vi st, en;
int n = 0;
while(k) {
if(k % 2 == 1) {
st.push_back(n);
k /= 2;
}
else {
en.push_back(n);
k--;
}
n--;
}
for(int &a : st) a = abs(a);
for(int &b : en) b = abs(b);
// cout << " st = "; for(int a : st) cout << a << ' '; cout << endl;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |