#include<bits/stdc++.h>
#include "perm.h"
using namespace std;
#define ff first
#define ss second
vector<int> construct_permutation(long long k){
int need=-1;
if(k%2) need++;
for(int i=1; i<60; i++){
if(k&(1ll<<i)) need+=i;
}
vector<int> v;
for(int i=60; i>0; i--){
if(k&(1ll<<i)){
need-=i;
int x=need+1;
for(int z=0; z<i; z++,x++){
v.push_back(x);
}
}
}
if(k%2) v.push_back(need);
return v;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |