Submission #1367008

#TimeUsernameProblemLanguageResultExecution timeMemory
1367008loomPermutation (APIO22_perm)C++20
91.33 / 100
1 ms344 KiB
#include "perm.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inf (ll)2e18
#define _ <<' '<<
#define nl '\n'

vector<int> construct_permutation(ll k){
   vector<int> v;

   for(int i = 59; i >= 0; i--){
      if(!(k & 1ll<<i)) continue;

      if(v.empty()){
         for(int j = 0; j < i; j++) v.push_back(j);
      }
      else{
         for(int j = i; j < v.size(); j++) v[j]++;
         v.push_back(i);
      }
   }

   return v;
}
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...