제출 #744832

#제출 시각아이디문제언어결과실행 시간메모리
744832Teemka순열 (APIO22_perm)C++17
10 / 100
1 ms340 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...