Submission #744836

#TimeUsernameProblemLanguageResultExecution timeMemory
744836TeemkaPermutation (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 ; int h = log2(k) , a[60] = {} , 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...