Submission #982836

# Submission time Handle Problem Language Result Execution time Memory
982836 2024-05-14T19:28:57 Z vjudge1 Permutation (APIO22_perm) C++17
0 / 100
0 ms 348 KB
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;

std::vector<int> construct_permutation(long long k)
{
	vector <int> resp;

	long long pot = 0, prev = 1;

	while (prev <= k)
	{
		pot = prev;
		prev *= 2;
	}

	long long diff = k - pot;

	for (int i = pot + diff ; i >= pot; i--)
	{
		resp.push_back(i);
	}

	for (int i = 0; i <= pot; i++)
	{
		resp.push_back(pot);
	}
	


	return resp;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -