# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
623820 | iomoon191 | Permutation (APIO22_perm) | C++17 | 4 ms | 340 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>
using ll = long long;
//#define int ll
using namespace std;
#define sz(x) (int)(x).size()
#define foru(i, l, r) for(int i = l; i <= r; i++)
#define ford(i, l, r) for(int i = l; i >= r; i--)
#define fi first
#define se second
#define mod 998244353
#define db(x) cerr << __LINE__ << " " << #x << " " << x << "\n"
using vi = vector<int>;
using pi = pair<int, int>;
const ll N = 200005;
const ll inf = 1e18;
vi construct_permutation(ll k){
if(k == 1) return {};
if(k == 2) return {0};
if(k == 3) return {1, 0};
vi d = construct_permutation(k >> 2);
int s = sz(d);
if(k % 4 == 0){
d.push_back(s);
d.push_back(s + 1);
return d;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |