# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
573687 | 2022-06-07T05:13:05 Z | Jomnoi | Permutation (APIO22_perm) | C++17 | 3 ms | 340 KB |
#include <bits/stdc++.h> #include "perm.h" using namespace std; vector <int> construct_permutation(long long k) { deque <int> p; vector <int> binary; while(k > 0) { binary.push_back(k % 2); k /= 2; } reverse(binary.begin(), binary.end()); int n = 0; for(int i = 1; i < binary.size(); i++) { p.push_back(n++); if(binary[i] == 1) { p.push_front(n++); } } return vector <int> (p.begin(), p.end()); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 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 | 340 KB | Partially correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
7 | Correct | 1 ms | 340 KB | Output is correct |
8 | Partially correct | 2 ms | 340 KB | Partially correct |
9 | Correct | 1 ms | 340 KB | Output is correct |
10 | Partially correct | 3 ms | 340 KB | Partially correct |
11 | Partially correct | 1 ms | 340 KB | Partially correct |
12 | Partially correct | 2 ms | 340 KB | Partially correct |
13 | Partially correct | 2 ms | 340 KB | Partially correct |