# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
993263 | thelegendary08 | Permutation (APIO22_perm) | C++17 | 7 ms | 1116 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>
#define vi vector<int>
#define f0r(i, n) for(int i = 0;i<n;i++)
#define ll long long int
#define pb push_back
using namespace std;
static long long MX = 1e18;
std::vector<int> construct_permutation(long long k)
{
k--;
vi ans;
vi nums;
vi nums2;
int ansl = 0;
ll cur;
for(int i = 59; i > 1; i--){
cur = (1LL << i) + (1LL << (i - 1)) - 1;
if(k > cur){
k -= cur;
ansl += i + 1;
nums2.pb(i);
}
}
for(int i = 59; i > 1; i--){
cur = (1LL << i) - 1;
if(k > cur){
k -= cur;
ansl += i;
nums.pb(i);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |