# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
572596 | arthur_nascimento | Permutation (APIO22_perm) | C++17 | 3 ms | 340 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>
#define ll long long
#define pii pair<int,int>
#define pb push_back
using namespace std;
std::vector<int> construct_permutation(long long k)
{
// k++;
ll aux = k, sz = 0;
while(aux)
aux /= 2, sz++;
vector<pii> ans;
for(int i=0;i<sz-1;i++)
ans.pb({2*i,i+1});
vector<int> dec;
dec.pb(1);
int x = 1, y = 0, skip = 0;
for(int i=sz-2;i>=0;i--, x += 2, y--){
if((k & (1ll << i)) == 0) continue;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |