# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
580266 | angelo_torres | 순열 (APIO22_perm) | C++17 | 2 ms | 352 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define f(i,j,n) for(ll i = j; i < n; ++i)
#define fr(i,j,n) for(ll i = j; i >= n; --i)
#define sz(v) (ll) v.size()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
const int N = 4e3 + 20;
const ll mod = 1e9 + 7;
vi construct_permutation(ll k){
ll aux = k, cn = 0;
vll in[5];
ll np[5];
in[1] = {}, in[2] = {0}, in[3] = {1,0};
np[1] = -1, np[2] = 0, np[3] = 1;
while(aux >= 4) aux >>= 2, cn++;
vll ans = in[aux];
ll na = np[aux];
fr(i,cn,1){
ll j = (k>>(2*(i-1)))%4;
if(j == 0){
ans.push_back(++na);
ans.push_back(++na);
}
if(j == 1){
ans.push_back(++na);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |