# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
850041 | Andrey | Permutation (APIO22_perm) | C++17 | 2 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;
vector<int> construct_permutation(long long k) {
vector<int> ans(0);
vector<int> haha(0);
while(k > 0) {
haha.push_back(k%4);
k/=4;
}
reverse(haha.begin(),haha.end());
bool yeah = false;
if(haha[0] == 2) {
ans.push_back(0);
}
else if(haha[0] == 3) {
ans.push_back(1);
ans.push_back(0);
yeah = true;
}
for(int i = 1; i < haha.size(); i++) {
if(haha[i] == 0) {
ans.push_back(ans.size());
ans.push_back(ans.size());
}
else if(haha[i] == 1) {
ans.push_back(ans.size());
ans.push_back(ans.size());
for(int j = 0; j < ans.size(); j++) {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |