Submission #741541

#TimeUsernameProblemLanguageResultExecution timeMemory
741541MauvePermutation (APIO22_perm)C++17
91.33 / 100
2 ms340 KiB
#include "perm.h" #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define INF 1e18 #define ss second #define ff first ll n,m,i,j,ii,jj,l,r,k; std::vector<int> construct_permutation(long long k) { vector<int> v,suffix; l=1; for(i=0;i<=60;i++){ if(l&k){ j=i; } l*=2; } l=1; int r=0; for(i=0;i<j;i++){ if(l&k){ suffix.pb(r); r++; } l*=2; v.pb(r); r++; } for(i=suffix.size()-1;i>=0;i--) v.pb(suffix[i]); return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...