Submission #601323

# Submission time Handle Problem Language Result Execution time Memory
601323 2022-07-21T17:18:40 Z IvanJ Permutation (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;
}

# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 296 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 296 KB Output isn't correct
2 Halted 0 ms 0 KB -