# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
959329 | zeta7532 | Permutation (APIO22_perm) | C++17 | 1 ms | 384 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>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
const ll mod = 998244353;
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define faster ios::sync_with_stdio(false);cin.tie(nullptr)
std::vector<int> construct_permutation(long long k)
{
if(k==1) return {};
if(k==2) return {0};
if(k==3) return {1,0};
if(k%4==0){
vector<int> A=construct_permutation(k/4);
A.push_back(A.size());
A.push_back(A.size());
return A;
}
if(k%4==1){
vector<int> A=construct_permutation(k/4);
A.push_back(A.size());
A.push_back(A.size());
rep(i,A.size()) A[i]++;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |