| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1177493 | Agageldi | 순열 (APIO22_perm) | C++20 | 1 ms | 328 KiB |
#include "bits/stdc++.h"
#include "perm.h"
// #include "grader.cpp"
using namespace std;
vector<int> construct_permutation(long long k) {
deque <int> v;
vector <int> ans;
bool tr = 0;
int last = 0;
for(long long i = 60; i >= 0; i--) {
if(k & (1LL<<i)) {
if(!tr) {
tr = 1;
for(int j = 0; j < i; j++) {
v.push_back(j);
}
last = i;
}
else {
v.push_front(last);
for(int j = 0; j < i; j++) {
swap(v[j], v[j + 1]);
}
last++;
}
}
}
for(auto i : v) {
ans.push_back(i);
}
return ans;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
