# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
652952 | aryan12 | Permutation (APIO22_perm) | C++17 | 4 ms | 340 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> construct_permutation(long long k)
{
k--;
long long cnt = 0;
while(true)
{
if((1LL << (cnt + 1)) - 1 <= k)
{
cnt++;
}
else
{
break;
}
}
k -= (1LL << cnt) - 1;
// cout << "cnt = " << cnt << endl;
vector<int> ans;
int omk = 1;
for(int i = 0; i < cnt; i++)
{
ans.push_back(omk);
omk += 3;
}
omk -= 4;
// cout << "k = " << k << endl;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |