# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1107173 | vladilius | Permutation (APIO22_perm) | C++17 | 1 ms | 504 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 <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
vector<int> construct_permutation(ll k){
vector<int> p;
int cc = 0;
if (k % 2){
p.pb(1e9);
p.pb(cc++);
k = (k - 1) / 2 - 1;
}
else {
p.pb(cc++);
k = k / 2 - 1;
}
while (k > 0){
if (k % 2){
p.pb(cc++);
k = (k - 1) / 2;
}
else {
if ((k + 1) % 3 == 0){
p.pb(cc + 1);
p.pb(cc);
cc += 2;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |