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"
#define F first
#define S second
#define OK cout << "------OK---------" << endl;
#define deb(x) cout << #x << " = " << x << endl;
#define ll long long
using namespace std ;
const int N = 500 + 7;
const int INF = 1e9 + 7 ;
const int dx[4] = {0 , 1 , 0 , -1} , dy[4] = {1 , 0 , -1 , 0} ;
vector<int> construct_permutation(ll k){
vector<int > ans ;
vector<pair<int ,int > > p ;
int h = log2(k) , a[100] = {} , cur = h ;
for(int i = h - 1; i >= 0 ; i--){
if(k & (1ll << i )){
a[i] = cur ;
cur++;
}
}
for(int i = 0 ; i<= h - 1; i++){
if(a[i])
ans.push_back(a[i]) ;
ans.push_back(i) ;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |