| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1356653 | Toto | Permutation (APIO22_perm) | C++20 | 1 ms | 344 KiB |
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> construct_permutation(long long k)
{
vector<int> ans;
int minn=-1,maxn=0;
while(k>1){
if(k%2){
ans.push_back(maxn);
maxn++;
k--;
} else {
ans.push_back(minn);
minn--;
k/=2;
}
}
int total=ans.size();
for(int i=0;i<total;i++){
if(ans[i]<0)ans[i]=total+ans[i];
}
reverse(ans.begin(),ans.end());
return ans;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
