# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1117741 | erering | Permutation (APIO22_perm) | C++17 | 1 ms | 336 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 <bits/stdc++.h>
//#include "perm.h"
using namespace std;
#define endl '\n'
#define pb push_back
vector<int> construct_permutation(long long k)
{
long long a[300];
for(int i=0;i<300;i++)a[i]=0;
long long cnt=1,f=0;
for(long long i=62;i>=0;i--){
if((k>>i)&1){
if(cnt==1){
for(int j=1;cnt<=i;j+=2){
a[j]=cnt++;
a[j]+=200;
}
f=2;
continue;
}
else{
a[f]=-1;
}
f+=2;
}
}
vector<int> v;
int s=1;
for(int i=299;i>=0;i--){
if(a[i]==-1)a[i]=s++;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |