Submission #975516

# Submission time Handle Problem Language Result Execution time Memory
975516 2024-05-05T11:42:53 Z KK_1729 Permutation (APIO22_perm) C++17
Compilation error
0 ms 0 KB
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;

std::vector<int> construct_permutation(long long k)
{	
	// vector<int> a;
	// while (k > 2){
	// 	if (k%2 == 1){
	// 		a.pb(1);
	// 		k--;
	// 	}else{
	// 		a.pb(0);
	// 		k/=2;
	// 	}
	// }
	// reverse(a.begin(), a.end());


	// int mini = 0; int maximum = 2;
	// cout << 	
	vector<int> ans;
	for (int i = k-1; i >= 0; i--) ans.pb(i);
	return ans;
}

Compilation message

perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:23:37: error: 'class std::vector<int>' has no member named 'pb'
   23 |  for (int i = k-1; i >= 0; i--) ans.pb(i);
      |                                     ^~