이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "perm.h"
#include<bits/stdc++.h>
using namespace std;
#define int long long
vector<int32_t> construct_permutation(int k)
{
int dv = 1;
deque<int> ans;
if(k%3 == 0) {
k/=3;
dv = 3;
}
int lg = 0;
for(int i = 0; i <= 60; i++) {
if(k >= (1LL<<i)) lg = i;
}
for(int i = lg-1; i >= 0; i--) {
ans.push_back((int) ans.size());
if(k&(1LL<<i)) ans.push_front((int) ans.size());
}
//adiociona algo que multiplica por 3 agora
if(dv == 3) {
ans.push_back((int) ans.size()+1);
ans.push_back((int) ans.size()-1);
}
vector<int32_t> vc;
for(auto x : ans) {
vc.push_back(x);
}
return vc;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |