Submission #601323

#TimeUsernameProblemLanguageResultExecution timeMemory
601323IvanJPermutation (APIO22_perm)C++17
0 / 100
0 ms296 KiB
#include<bits/stdc++.h> #include "perm.h" #define pb push_back #define all(a) (a).begin(), (a).end() using namespace std; typedef long long ll; vector<int> construct_permutation(ll k) { deque<int> q; vector<int> v; for(;k > 0;k >>= 1) v.pb(k & 1); reverse(all(v)); int num = 0; for(int i : v) if(!i) q.pb(num++); else q.push_front(num++); vector<int> p; while(q.size()) p.pb(q.front()), q.pop_front(); return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...