# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1065687 | stdfloat | Permutation (APIO22_perm) | C++17 | 2 ms | 372 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>
#include "perm.h"
// #include "grader.cpp"
using namespace std;
using ll = long long;
vector<int> construct_permutation(ll k) {
bool tr1 = false, tr2 = false;
int mn = 0, smn = 0, mx = -1;
vector<double> v;
for (int i = 59; i >= 0; i--) {
if (!tr1 && !((k >> i) & 1)) continue;
bool x = (k >> i) & 1;
if (!i) {
v.push_back(++mx);
if (x) v.push_back(--mn);
break;
}
bool y = (k >> (i - 1)) & 1;
if (!x && !y) {
v.push_back(++mx);
v.push_back(++mx);
if (!tr1) smn = 1;
}
else if (!x) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |