Submission #897014

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8970142024-01-02 12:19:05vjudge1Permutation (APIO22_perm)C++17
71.22 / 100
537 ms1508 KiB
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 5e3+3, M = 3e2+2, X = 3e2+2;
const ll L = 62;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<int> construct_permutation(ll k)
{
vector<int> p;
if (!k) return p;
ll K = k;
k--;
int r = N;
//vector<int> p2;
for (int j = L; j > 0; j--) {
//cerr << k << " " << j << " " << (1ll << j) << " " << (1ll << j) - 1ll << endl;
if (k >= (1ll << j) - 1ll) {
k -= (1ll << j) - 1ll;
for (int l = 1; l <= j; l++) {
/*p2*/p.push_back(r-j+l);
}
//cerr << j << endl;
r -= j;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...