# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
896987 | vjudge1 | Permutation (APIO22_perm) | C++17 | 142 ms | 1616 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 5e3+3, M = 2e2+2;
const ll L = 62;
vector<int> construct_permutation(ll k)
{
vector<int> p;
if (!k) return p;
for (int i = 1; i <= M; i++) {
// cojo i subsequences
// he de sumar k+i-1
ll nwK = k+i-1;
int cnt[L+1];
for (int j = L; j >= 0; j--) {
cnt[j] = (((nwK >> j) & 1) ? 1 : 0);
}
int c = __builtin_popcountl(nwK);
while (c < i) {
bool b = 0;
for (int j = L; j > 0; j--) {
if (cnt[j]) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |