# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
911301 | 2024-01-18T18:03:34 Z | hjroh0315 | Permutation (APIO22_perm) | C++17 | 2 ms | 356 KB |
#include"perm.h" #include<bits/stdc++.h> using namespace std; std::vector<int>construct_permutation(long long k) { vector<int>ans; auto f=k;int last=-1; for(int i=0;i<62;i++) { if(f>0) { if(f&1)f--; if(f>0)ans.push_back(i); last=i; f>>=1; } } last--; while(last>=0) { if(k>>last&1) { for(int i=0;i<size(ans);i++) { if(ans[i]>=last)ans[i]++; } ans.push_back(last); } last--; } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 1 ms | 344 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 1 ms | 344 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 | 2 ms | 348 KB | Partially correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Partially correct | 2 ms | 348 KB | Partially correct |
9 | Correct | 1 ms | 356 KB | Output is correct |
10 | Partially correct | 2 ms | 348 KB | Partially correct |
11 | Partially correct | 2 ms | 348 KB | Partially correct |
12 | Partially correct | 2 ms | 348 KB | Partially correct |
13 | Partially correct | 2 ms | 348 KB | Partially correct |