# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
699855 | 2023-02-18T07:18:34 Z | sharaelong | Permutation (APIO22_perm) | C++17 | 2 ms | 340 KB |
#include "perm.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; vector<int> construct_permutation(ll k) { int pow = 0; while ((1ll << pow) <= k) pow++; pow--; int cnt = pow; vector<int> arr(pow, -1); for (int i=pow-1; i>=0; --i) { if (k & (1ll << i)) { arr[i] = pow++; } } vector<int> ret; for (int i=0; i<arr.size(); ++i) { if (arr[i] != -1) ret.push_back(arr[i]); ret.push_back(i); } return ret; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 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 | 300 KB | Partially correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
7 | Correct | 1 ms | 340 KB | Output is correct |
8 | Partially correct | 1 ms | 340 KB | Partially correct |
9 | Correct | 1 ms | 340 KB | Output is correct |
10 | Partially correct | 2 ms | 300 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 |