# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1065065 | sammyuri | Permutation (APIO22_perm) | C++17 | 6 ms | 348 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;
typedef long long ll;
vector<int> normalise(vector<int> xx, int fac = 2) {
vector<int> values = xx;
sort(values.begin(), values.end());
vector<int> ans;
for (auto a : xx) {
auto it = lower_bound(values.begin(), values.end(), a);
ans.push_back(fac * (it - values.begin()));
}
return ans;
}
const int BIG = 1000, SMALL = -1;
std::vector<int> construct_permutation(long long k) {
// build initial permutation
ll curpow = 2;
vector<int> ans;
vector<int> digits;
while (k) {
digits.push_back(k % 4);
k /= 4;
}
if (digits.back() == 1)
ans = {};
else if (digits.back() == 2)
ans = {0};
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |