Submission #1177419

#TimeUsernameProblemLanguageResultExecution timeMemory
1177419tkm_algorithmsPermutation (APIO22_perm)C++20
Compilation error
0 ms0 KiB
/**
*    In the name of Allah
*    We are nothing and you're everything
**/
#include <bits/stdc++.h>
//#include "swap.h"
#include "perm.h"
using namespace std;
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
//#define int ll
const char nl = '\n';
const int N = 3e5+10;
const int inf = 1e9;

int calc(vector<int> &c) {
	int n = sz(c), sum = 0;
	for (int i = 0; i <= (1 << n); ++i) {
		int onki = -1; bool ok = true;
		for (int j = 0; j < n; ++j) 
			if ((i & j) > 0) {
				if (j < onki){ok = false; break; }
				onki = j;
			}
		if (ok)sum += 1;
	}
	return sum;
}

vector<int> construct_permutation(int64 k) {
	//vector<int> b{2, 4, 8, 16, 32, 64, 128, 256};
	
	//int s = lower_bound(all(b), k) - b.begin();
	//for (int i = sz(b)-1; i >= 0; --i) {
		//vector<int> c;
		//for (int j = 0; j <= i; ++j)c.push_back(j);
		//int t = calc(c);
		//do {
			
		//} while (next_permutation(all(c)));
	//}
	vector<int> b;
	for (int i = k-2; i >= 0; --i)b.push_back(i);
	
	return b;
}

//int main() {
	
	//return 0;
//}

Compilation message (stderr)

perm.cpp:31:35: error: 'std::vector<int> construct_permutation' redeclared as different kind of entity
   31 | vector<int> construct_permutation(int64 k) {
      |                                   ^~~~~
In file included from perm.cpp:7:
perm.h:3:18: note: previous declaration 'std::vector<int> construct_permutation(long long int)'
    3 | std::vector<int> construct_permutation(long long k);
      |                  ^~~~~~~~~~~~~~~~~~~~~
perm.cpp:31:35: error: 'int64' was not declared in this scope
   31 | vector<int> construct_permutation(int64 k) {
      |                                   ^~~~~