| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1353722 | 12345678 | 순열 (APIO22_perm) | C++17 | 1 ms | 344 KiB |
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
std::vector<int> construct_permutation(long long k)
{
k-=1;
vector<int> res;
int idx=0;
while ((1ll<<idx)<=k) k-=(1ll<<idx), res.push_back(idx), idx++;
for (int i=60; i>=0; i--)
{
if (k&(1ll<<i))
{
// insert i+1 inside
vector<int> newres;
for (auto x:res) newres.push_back(x+(x>=i));
newres.push_back(i);
res=newres;
}
}
return res;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
