# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1049133 | Marco_Escandon | Permutation (APIO22_perm) | C++17 | 3 ms | 492 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;
typedef long long ll;
std::vector<int> construct_permutation(long long k)
{
vector<int> cad;
for(int i=0; i<64; i++)
{
cad.push_back(i);
}
ll k2=k;
ll p=64;
ll pl=0;
for(ll i=60; i>-1; i--)
{
if((k&(1LL<<i))!=0)
{
vector<int> cad2;
ll asdf=0;
for(int j=0; asdf<i-1+pl; j++)
{
if(cad[j]==asdf)
asdf++;
cad2.push_back(cad[j]);
}
cad2.push_back(p++);
for(int j=asdf; j<cad.size(); j++)
{
cad2.push_back(cad[j]);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |