Language: C++

#include <bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);++i)
#define loop for(;;)
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;
#define all(v) begin(v),end(v)
#define pb push_back
#define inf (1e9)
#define eps (1e-9)

#typedef long long int Integer;
#typedef vector<int> vi;

vi lsi(vi xs) {
  vvi bins;
  vi bots;
  for (int x: xs) {
    auto it = lower_bound(begin(bots), end(bots), x);
    if (it == end(bots)) {
      bins.push_back({x});
      bots.push_back(x);
    } else {
      bins[it - begin(bots)].push_back(x);
      *it = x;
    }
  }
  int n = bots.size();
  vi ret(n);
  int x = inf;
  for (--n; n>=0; --n) {
    reverse(begin(bins[n]), end(bins[n]));
    x = *(lower_bound(begin(bins[n]), end(bins[n]), x) - 1);
    ret[n] = x;
  }
  return ret;
}

int solve(int n, Integer s) {
  vi xs(10);
  vi ys(n);
  rep (i, 10) xs[i] = i;
  set<vi> aa;
  do {
    Integer t = 0;
    rep (i, n) {
      t += xs[i] * (i+1);
      ys[i] = xs[i];
    }
    if (t == s) {
      aa.insert(ys);
    }
  } while (next_permutation(all(xs)));
  return aa.size();
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout.setf(ios::fixed);
  cout.precision(10);
  random_device dev;
  mt19937 rand(dev());

  int n; Integer s;
  while (cin >> n >> s) {
    cout << solve(n, s) << endl;
  }

  return 0;
}

Compiler output:
a.cc:12:2: error: invalid preprocessing directive #typedef
   12 | #typedef long long int Integer;
      |  ^~~~~~~
a.cc:13:2: error: invalid preprocessing directive #typedef
   13 | #typedef vector<int> vi;
      |  ^~~~~~~
a.cc:15:1: error: 'vi' does not name a type; did you mean 'void'?
   15 | vi lsi(vi xs) {
      | ^~
      | void
a.cc:39:18: error: 'Integer' has not been declared
   39 | int solve(int n, Integer s) {
      |                  ^~~~~~~
a.cc: In function 'int solve(int, int)':
a.cc:40:3: error: 'vi' was not declared in this scope
   40 |   vi xs(10);
      |   ^~
a.cc:41:5: error: expected ';' before 'ys'
   41 |   vi ys(n);
      |     ^~~
      |     ;
a.cc:42:15: error: 'xs' was not declared in this scope; did you mean 's'?
   42 |   rep (i, 10) xs[i] = i;
      |               ^~
      |               s
a.cc:43:9: error: template argument 2 is invalid
   43 |   set<vi> aa;
      |         ^
a.cc:43:9: error: template argument 3 is invalid
a.cc:45:5: error: 'Integer' was not declared in this scope
   45 |     Integer t = 0;
      |     ^~~~~~~
a.cc:47:7: error: 't' was not declared in this scope
   47 |       t += xs[i] * (i+1);
      |       ^
a.cc:47:12: error: 'xs' was not declared in this scope; did you mean 's'?
   47 |       t += xs[i] * (i+1);
      |            ^~
      |            s
a.cc:48:7: error: 'ys' was not declared in this scope; did you mean 's'?
   48 |       ys[i] = xs[i];
      |       ^~
      |       s
a.cc:50:9: error: 't' was not declared in this scope
   50 |     if (t == s) {
      |         ^
a.cc:51:10: error: request for member 'insert' in 'aa', which is of non-class type 'int'
   51 |       aa.insert(ys);
      |          ^~~~~~
a.cc:51:17: error: 'ys' was not declared in this scope; did you mean 's'?
   51 |       aa.insert(ys);
      |                 ^~
      |                 s
a.cc:53:33: error: 'xs' was not declared in this scope; did you mean 's'?
   53 |   } while (next_permutation(all(xs)));
      |                                 ^~
a.cc:7:22: note: in definition of macro 'all'
    7 | #define all(v) begin(v),end(v)
      |                      ^
a.cc:54:13: error: request for member 'size' in 'aa', which is of non-class type 'int'
   54 |   return aa.size();
      |             ^~~~
a.cc: In function 'int main()':
a.cc:65:10: error: 'Integer' was not declared in this scope
   65 |   int n; Integer s;
      |          ^~~~~~~
a.cc:66:22: error: 's' was not declared in this scope
   66 |   while (cin >> n >> s) {
      |                      ^