Submission #1068931

#TimeUsernameProblemLanguageResultExecution timeMemory
1068931kilikuma순열 (APIO22_perm)C++17
Compilation error
0 ms0 KiB
#include "perm.h"
#include <bits/stdc++.h>

using namespace std;

int cur;

vector<int> ans;

void construct(int k) {
	if (k == 1) {
		return;
	}
	if (k % 2 == 1) {
		construct(k - 1);
		ans.insert(ans.begin(), -1);
	}
	else {
		construct(k);
		ans.push_back(cur);
		cur ++: 
	}
	return;
}

vector<int> construct_permutation(long long k)
{

	cur = 1;
	ans.clear();

	construct(k);

	for (int i = ans.size() - 1; i >= 0; i --) {
		if (ans[i] == (-1)) {
			ans[i] = cur;
			cur ++;
		}
	}

}

Compilation message (stderr)

perm.cpp: In function 'void construct(int)':
perm.cpp:21:9: error: expected ';' before ':' token
   21 |   cur ++:
      |         ^
      |         ;
perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:41:1: warning: no return statement in function returning non-void [-Wreturn-type]
   41 | }
      | ^