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 <bits/stdc++.h>
using namespace std;
#define F first
#define S second
using ll = long long;
const int INF = 1e9 + 7;
const int MOD = 998244353;
vector<int> construct_permutation(ll k)
{
vector<int> ans;
int a = 0, b = -1;
bool o = 0;
for (int i = 63; i >= 0; i--)
{
if ((k & (1ll << i)) && !o)
{
o = 1;
continue;
}
if (!o)
continue;
ans.push_back(a);
a++;
if (k & (1ll << i))
{
ans.push_back(b);
b--;
}
}
for (int &i : ans)
i += -b - 1;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |