| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1356230 | nathlol2 | Permutation (APIO22_perm) | C++20 | 1 ms | 348 KiB |
#include "perm.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<int> construct_permutation(ll k){
vector<int> ans;
ll c = 1;
int cc = 0;
while(c * 2 <= k){
ans.push_back(cc++);
c *= 2;
}
k -= c;
for(ll b = 60;b>=0;b--){
if(k & (1LL << b)){
ans.push_back(ans[b]);
for(int i = b;i<cc;i++) ans[i]++;
++cc;
}
}
return ans;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
