# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
760595 | coding_snorlax | Permutation (APIO22_perm) | C++17 | 11 ms | 1320 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 "perm.h"
#include<bits/stdc++.h>
using namespace std;
//Main function split it to #(2^k-1)
int cal_log2(long long int k){
int ans = 0;
while(k>>=1) ++ans;
return ans;
}
long long int cal_pow(int a){
long long int ans = 1;
while(a){
ans*=2;
a-=1;
}
return ans;
}
vector<int> split(long long int k){
vector<int> ans;
while(k){
//cout << k << " ";
long long int a = cal_log2(k+1);
ans.push_back(a);
k -= (long long int) cal_pow(a)-1;
}
return ans;
}
vector<int> construct_permutation(long long int k)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |