#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> construct_permutation(long long k){
long long num = 1;
vector< int > ret;
while(num * 2 <= k){
ret.push_back((int)ret.size());
num *= 2;
}
for(int it = 61;it >= 0;it--){
if(num + (1LL << it) <= k){
num += (1LL << it) ;
ret.insert(ret.begin() + it , (int)ret.size());
}
}
return ret;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
300 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
300 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Partially correct |
1 ms |
340 KB |
Partially correct |
6 |
Correct |
1 ms |
300 KB |
Output is correct |
7 |
Correct |
2 ms |
340 KB |
Output is correct |
8 |
Partially correct |
1 ms |
340 KB |
Partially correct |
9 |
Correct |
2 ms |
340 KB |
Output is correct |
10 |
Partially correct |
3 ms |
340 KB |
Partially correct |
11 |
Partially correct |
2 ms |
340 KB |
Partially correct |
12 |
Partially correct |
2 ms |
340 KB |
Partially correct |
13 |
Partially correct |
2 ms |
296 KB |
Partially correct |