| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 739293 | CyberCraze | Permutation (APIO22_perm) | C++17 | 6 ms | 596 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 FOR(i,a,b) for(ll i=a;i<b;i++)
using namespace std;
vector<int> construct_permutation(ll k){
//consecutive list of length n=2^n sets
int lbit=__lg(k);
ll ix=0;
vector<int> ans;FOR(i,0,lbit){ans.push_back(ix);ix++;};
k-=pow(2,lbit);
//2^n, the rest is 2^n-1
while(lbit!=0){
lbit=__lg(k+1);
k-=(pow(2,lbit)-1);
FOR(i,0,lbit){ans.insert(ans.begin()+i,ix);ix++;};
};
return ans;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
