# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1177419 | tkm_algorithms | Permutation (APIO22_perm) | C++20 | 0 ms | 0 KiB |
/**
* In the name of Allah
* We are nothing and you're everything
**/
#include <bits/stdc++.h>
//#include "swap.h"
#include "perm.h"
using namespace std;
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
//#define int ll
const char nl = '\n';
const int N = 3e5+10;
const int inf = 1e9;
int calc(vector<int> &c) {
int n = sz(c), sum = 0;
for (int i = 0; i <= (1 << n); ++i) {
int onki = -1; bool ok = true;
for (int j = 0; j < n; ++j)
if ((i & j) > 0) {
if (j < onki){ok = false; break; }
onki = j;
}
if (ok)sum += 1;
}
return sum;
}
vector<int> construct_permutation(int64 k) {
//vector<int> b{2, 4, 8, 16, 32, 64, 128, 256};
//int s = lower_bound(all(b), k) - b.begin();
//for (int i = sz(b)-1; i >= 0; --i) {
//vector<int> c;
//for (int j = 0; j <= i; ++j)c.push_back(j);
//int t = calc(c);
//do {
//} while (next_permutation(all(c)));
//}
vector<int> b;
for (int i = k-2; i >= 0; --i)b.push_back(i);
return b;
}
//int main() {
//return 0;
//}