| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1364364 | not_amir | 순열 (APIO22_perm) | C++20 | 1 ms | 344 KiB |
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> construct_permutation(ll k)
{
k--;
vector<int> p;
vector<ll> cnt;
while (k) {
ll c = 1;
int i = 0;
while (i < cnt.size()) {
if (c + cnt[i] > k)
break;
c += cnt[i++];
}
k -= c;
cnt.push_back(c);
for (int &x : p)
if (x >= i)
x++;
p.push_back(i);
}
return p;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
