# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
805768 | BT21tata | Permutation (APIO22_perm) | C++17 | 6 ms | 340 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>
typedef long long ll;
#define pb push_back
using namespace std;
vector<int> construct_permutation(ll k)
{
vector<int>v, b;
while(k)
{
b.pb(k%4);
k/=4;
}
reverse(b.begin(), b.end());
if(b[0]==2) v.pb(0);
else if(b[0]==3) v={1, 0};
for(int i=1; i<(int)b.size(); i++)
{
if(b[i]==0)
{
v.pb(1e9);
v.pb(1e9+1);
}
else if(b[i]==1)
{
v.pb(1e9);
v.pb(1e9+1);
v.pb(-1);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |