Language: C++

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <stack>
#include <queue>
#include <random>
#define INF (1<<21)
#define swap(a,b) {a=a+b; b=a-b; a=a-b;}
#define abs(a) (a > 0 ? a:-a)

using namespace std;

int rec() {
	if (choose_size == N) {
		int sum = 0;
		for (int i = 0; i < N; i++) {
			sum += (i + 1) * choose[i];
		}
		return ans == sum;
	}

	int cnt = 0;
	for (int i = 0; i < rest_size; i++) {
		choose[choose_size++] = rest[i];
		for (int j = i; j < rest_size-1; j++) {
			rest[j] = rest[j + 1];
		}
		rest_size--;
		
		cnt += rec();

		rest_size++;
		for (int j = rest_size-1; j > i; j--) {
			rest[j] = rest[j-1];
		}
		rest[i] = choose[--choose_size];
	}
	return cnt;
}

void q70() {
	int n, s;
	for (; cin >> n >> s;) {
		N = n;
		ans = s;
		choose_size = 0;
		for (int i = 0; i < MAX_N; i++) {
			rest[i] = i;
		}
		rest_size = 10;
		cout << rec() << endl;;
	}
}

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

Compiler output:
a.cc: In function 'int rec()':
a.cc:19:13: error: 'choose_size' was not declared in this scope
   19 |         if (choose_size == N) {
      |             ^~~~~~~~~~~
a.cc:19:28: error: 'N' was not declared in this scope
   19 |         if (choose_size == N) {
      |                            ^
a.cc:22:42: error: 'choose' was not declared in this scope
   22 |                         sum += (i + 1) * choose[i];
      |                                          ^~~~~~
a.cc:24:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |                 return ans == sum;
      |                        ^~~
      |                        abs
a.cc:28:29: error: 'rest_size' was not declared in this scope
   28 |         for (int i = 0; i < rest_size; i++) {
      |                             ^~~~~~~~~
a.cc:29:17: error: 'choose' was not declared in this scope
   29 |                 choose[choose_size++] = rest[i];
      |                 ^~~~~~
a.cc:29:24: error: 'choose_size' was not declared in this scope
   29 |                 choose[choose_size++] = rest[i];
      |                        ^~~~~~~~~~~
a.cc:29:41: error: 'rest' was not declared in this scope
   29 |                 choose[choose_size++] = rest[i];
      |                                         ^~~~
a.cc: In function 'void q70()':
a.cc:49:17: error: 'N' was not declared in this scope
   49 |                 N = n;
      |                 ^
a.cc:50:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   50 |                 ans = s;
      |                 ^~~
      |                 abs
a.cc:51:17: error: 'choose_size' was not declared in this scope
   51 |                 choose_size = 0;
      |                 ^~~~~~~~~~~
a.cc:52:37: error: 'MAX_N' was not declared in this scope
   52 |                 for (int i = 0; i < MAX_N; i++) {
      |                                     ^~~~~
a.cc:53:25: error: 'rest' was not declared in this scope
   53 |                         rest[i] = i;
      |                         ^~~~
a.cc:55:17: error: 'rest_size' was not declared in this scope
   55 |                 rest_size = 10;
      |                 ^~~~~~~~~