# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
709760 | gun_gan | Permutation (APIO22_perm) | C++17 | 3 ms | 352 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>
using namespace std;
typedef long long ll;
const ll MX = 1e18;
vector<int> construct_permutation(ll k) {
ll b = 63 - __builtin_clzll(k);
ll c = 0;
vector<int> V;
for(int i = 0; i < b; i++) {
c += 100;
V.push_back(c);
}
vector<int> v;
for(int i = 0; i < b; i++) {
if(!(k >> i & 1)) continue;
int k = i;
for(int j = (int)V.size() - 1; j >= 0 && k >= 0; j--, k--) {
if(k == 0) v.push_back(i + 1 + V[j]);
}
}
for(auto x : V) v.push_back(x);
vector<int> vals;
for(auto x : v) vals.push_back(x);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |