// Source: https://usaco.guide/general/io
#include <bits/stdc++.h>
#include <perm.h>
using namespace std;
vector<int> construct_permutation(long long k) {
int z = __lg(k);
vector<int> p(z);
iota(p.begin(), p.end(), 0);
for (int i = z - 1; i >= 0; i--) {
if ((k >> i) & 1) {
p.insert(p.begin() + i, z++);
}
}
return p;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Partially correct |
1 ms |
344 KB |
Partially correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
484 KB |
Output is correct |
8 |
Partially correct |
1 ms |
344 KB |
Partially correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Partially correct |
1 ms |
348 KB |
Partially correct |
11 |
Partially correct |
1 ms |
348 KB |
Partially correct |
12 |
Partially correct |
1 ms |
348 KB |
Partially correct |
13 |
Partially correct |
1 ms |
348 KB |
Partially correct |