# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
598541 | MKopchev | Permutation (APIO22_perm) | C++17 | 3 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 "perm.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> compress(vector<int> a)
{
vector<int> help=a;
sort(help.begin(),help.end());
for(auto &w:a)
w=lower_bound(help.begin(),help.end(),w)-help.begin();
return a;
}
std::vector<int> construct_permutation(long long k)
{
int low=-100,high=100;
vector<int> outp={};
while(k>1)
{
if(k%2==0)
{
outp.push_back(high);
high--;
k=k/2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |