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 <iostream>
#include <vector>
#include <stack>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>
#include <sstream>
#include <chrono>
#include <cstring>
//#define int long long
#define INP freopen("palpath.in","r",stdin)
#define OUTP freopen("palpath.out","w",stdout)
using ld = long double;
using LD = ld;
using namespace std;
vector<int> construct_permutation(long long k) {
bitset<64> bits (k);
int mx = 0;
for (int i = 0; i < 64; i++) {
if (bits[i]) {
mx = i;
}
}
vector<int> res;
for (int i = 0; i < mx; i++) {
res.push_back(i);
}
for (int i = mx - 1; i >= 0; i--) {
if (!bits[i]) {
continue;
}
int resSize = res.size();
for (int j = 0; j < resSize; j++) {
if(res[j] >= i) {
res[j]++;
}
}
res.push_back(i);
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |