답안 #601323

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
601323 2022-07-21T17:18:40 Z IvanJ 순열 (APIO22_perm) C++17
0 / 100
0 ms 296 KB
#include<bits/stdc++.h>
#include "perm.h"

#define pb push_back
#define all(a) (a).begin(), (a).end()

using namespace std;

typedef long long ll;


vector<int> construct_permutation(ll k) {
	deque<int> q;
	vector<int> v;
	for(;k > 0;k >>= 1) v.pb(k & 1);
	reverse(all(v));
	int num = 0;
	for(int i : v)
		if(!i) q.pb(num++);
		else q.push_front(num++);
	vector<int> p;
	while(q.size()) p.pb(q.front()), q.pop_front();
	return p;
}

# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 296 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 296 KB Output isn't correct
2 Halted 0 ms 0 KB -