| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1362719 | hihi0908 | Permutation (APIO22_perm) | C++20 | 0 ms | 344 KiB |
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
std::vector<int> construct_permutation(long long k) {
vector<int> p;
vector<int> bits;
long long s = 0;
for(int i = 0; i < 64; i++){
if((1ll << i) & k){
bits.pb(i);
s += i;
}
}
s--;
for(int i : bits){
int cnt = s - i + 1;
for(int j = cnt; j <= s; j++) p.pb(j);
s -= i;
}
reverse(p.begin(), p.end());
return p;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
